Dear all,
Can someone help me loop across different rows performing multiple immediate statistical tests, i.e. "csi a b c d, exact" tests across rows and save the respective p value in a different column?
I was able to do it for just one row, since it is iterating on the same row and delivering the first row outcome several times, as much as the number of iterations needed.
Here is the code i am using:
[CODE][ gen id=_n
gen p_val=.
forvalues i = 1/`=_N' {
csi `=a' `=b' `=c' `=d', exact
replace in `i' p_val=r(p)
}/CODE]
Here is de data:
a b c d
1 28 11 20
5 24 6 25
3 26 4 27
5 24 11 20
2 27 4 27
1 28 13 18
1 28 12 19
4 25 7 24
2 27 13 18
0 29 2 29
2 27 2 29
2 27 5 26
3 26 0 31
2 27 1 30
9 20 14 17
3 26 6 25
0 29 4 27
0 29 0 31
16 13 5 26
6 23 3 28
Thank you in advance.
Gonçalo Cotovio
Related Posts with Multiple immediate test across rows
Boxplot of ProbabilitiesI've created a score that predicts mortality. Does anyone know what lines of code to use to create …
Importing and Assigning Data By YearHello, I'm working on a research paper in which I'm examining the relationship between sea surface …
Deleting a row header from a customized tableI am creating a Table 1 using the "collect" command in Stata. I would like to have a "Total" row at …
Picking initial values for a specificDear all, I have an unbalanced panel of 57,910 observations of country, industries and year (2003-2…
Mulitple CV graphs for lasso/elasticnet estimatesHi, I am running different regularized estimators, elasticnet and linear lasso. I want to plot Cross…
Subscribe to:
Post Comments (Atom)
0 Response to Multiple immediate test across rows
Post a Comment