How to generate continuos report card? - asp.net

I have following table and data in MS.SQL Server
Id StudentName Roll SubjectName FM PM OM
1 Peter 1 English 100 40 80
2 Peter 1 Math 100 40 95
3 Peter 1 Science 100 40 75
4 Mike 2 English 100 40 75
5 Mike 2 Math 100 40 57
6 Mike 2 Science 100 40 48
7 Bella 3 English 100 40 85
8 Bella 3 Math 100 40 75
9 Bella 3 Science 100 40 65
How to print this data as continuous report using using ASP.net data report?
I used list control in report, but it is repeating all the rows as separate report. Here I want to print only 3 reports as per the Student.

We can groupwise the list control to solve the above problem.

Related

How to write a loop for this case in R?

I have a data base with 121 rows and like 10 columns. One of these columns corresponds to Station, another to depth and the rest to chemical variables (temperature, salinity, etc.). I want to calculate the integrated value of these chemical properties by station, using the function oce::integrateTrapezoid. It's my first time doing a loop, so i dont know how. Could you help me?
dA<-matrix(data=NA, nrow=121, ncol=3)
for (Station in unique(datos$Station))
{dA[Station, cd] <- integrateTrapezoid(cd, Profundidad..m., "cA")
}
Station
Depth
temp
1
10
28
1
50
25
1
100
15
1
150
10
2
9
27
2
45
24
2
98
14
2
152
11
3
11
28.7
3
48
23
3
102
14
3
148
9

How to write code for Level 2 data for Multilevel Modeling using nlme package

I am struggling with how to describe level 2 data in my Multilevel Model in R.
I am using the nlme package.
I have longitudinal data with repeated measures. I have repeated observations for every subject across many days.
The Goal:
Level 1 would be the individual observations within the subject ID
Level 2 would be the differences between overall means between subject IDs (Cluster).
I am trying to determine if Test scores are significantly affected by study time, and to see if it's significantly different within subjects and between subjects.
How would I write the script if I want to do "Between Subjects" ?
Here is my script for Level 1 Model
model1 <- lme(fixed = TestScore~Studytime, random =~1|SubjectID, data=dataframe, na.action=na.omit)
Below is my example dataframe
`Subject ID` Observations TestScore Studytime
1 1 1 50 600
2 1 2 72 900
3 1 3 82 627
4 1 4 90 1000
5 1 5 81 300
6 1 6 37 333
7 2 1 93 900
8 2 2 97 1000
9 2 3 99 1200
10 2 4 85 600
11 3 1 92 800
12 3 2 73 900
13 3 3 81 1000
14 3 4 96 980
15 3 5 99 1300
16 4 1 47 600
17 4 2 77 900
18 4 3 85 950
I appreciate the help!

R Dataframe: Add new column as sum of certain other columns

Name Trial# Result ResultsSoFar
1 Bob 1 14 14
2 Bob 2 22 36
3 Bob 3 3 39
4 Bob 4 18 57
5 Nancy 2 33 33
6 Nancy 3 87 120
Hello, say I have the dataframe above. What's the best way to generate the "ResultsSoFar" column which is a sum of that person's results up to and including that trial (Bob's results do not include Nancy's and vice versa).
With data.table you can do:
library(data.table)
setDT(df)[, ResultsSoFar:=cumsum(Result), by=Name]
df
Name Trial. Result ResultsSoFar
1: Bob 1 14 14
2: Bob 2 22 36
3: Bob 3 3 39
4: Bob 4 18 57
5: Nancy 2 33 33
6: Nancy 3 87 120
Note:
If Trial# is not sorted, you can do setDT(df)[, ResultsSoFar:=cumsum(Result[order(Trial.)]), by=Name] to get the right order for the cumsum

R AOV Error() model is singular

I am trying to run an ANOVA on a 5x5 design, where each subject only saw 5 of the 25 possible conditions. So subject A saw,
1,1; 2,2; 3,3; 4,4; 5,5
and subject B saw
1,2; 2,3; 3;4, 4;5, 5,1 etc.
Is it incorrect to use a within subject ANOVA since its not a true within subjects design?
This is what I was using,
(aov(Risk ~ Moral * Age + Error(ID/(Moral * Age)), data = Home)
and I get
Warning in aov(Risk ~ Moral * Age + Error(ID/(Moral * Age)), data = Home) :
Error() model is singular
Here is a sample of the data
ID Age Moral Risk
1 90 two affair 2
2 90 eight vol 2
3 90 ten invol 2
4 90 four work 3
5 90 six gym 4
6 117 two affair 9
7 117 eight vol 2
8 117 ten invol 3
9 117 four work 9
10 117 six gym 10
11 70 two affair 3
12 70 eight vol 3
13 70 ten invol 2
14 70 four work 6
15 70 six gym 6
16 51 two affair 4
17 51 eight vol 3
18 51 ten invol 3
19 51 four work 4
20 51 six gym 6

Using one data frame as a mask for extracting data from another data frame in R

I am new to R and I'm struggling with a data formation issue. I'm attempting to extract a set of values from a data frame by using a separate data frame as the criteria for my selection.
As an example, here is my original data:
Raw Data:
1 A B C D E F
2 25 52 33 92 83 14
3 23 31 13 13 53 34
4 13 53 23 89 35 93
5 89 90 91 91 90 89
I'm trying to use a data frame of the same size similar to the following to "filter" that data:
Data Frame "mask":
1 08 09 10 08 09 10
2 1 2 3 4 1 2
3 1 2 3 4 1 2
4 2 3 4 1 2 3
5 2 3 4 1 2 3
For this example, I would like to form a vector from values in the raw data whos corresponding value in the data frame "mask" is equal to 1 and when the first row in the mask is equal to 8. In this case the result would be:
res = c(25, 23, 89, 91)
As I said, I'm relatively new to R and I have found that the simplest questions tend to be the most difficult to find answers for since most people don't have to ask them.. So hopefully this is a simple problem. =)
If this has been discussed elsewhere, a link would be very helpful. Otherwise any help is greatly appreciated.
If RDat and mask are the datasets
RDat[rep(colnames(mask)=="08",each=nrow(mask)) & (mask==1)]
#[1] 25 23 89 91
Update
This would be a bit more compact
RDat[colnames(mask)[col(mask)]=="08" & mask==1]
#[1] 25 23 89 91

Resources