Dear all,
This is my first post in the community (and also learning how to use Stata), so I hope I manage to follow all the rules. I am using the commands "table" and "collect" to build a table in Stata 17. According to a webinar on the topic presented by Chuck Huber (and hoping that I understood it correctly), to add the results of tests (like p-values), one runs the command for the test and then runs "return list" like in the following example:
ttest age, by(highbp)
return list
After this, appears a list of scalars that can be added to the table. My problem is that I need to add the p-value of a Kruskal_Wallis test and when I run "return list," I only obtain the following scalars:
kwallis f1dpi, by(f1dpiquar)
Kruskal–Wallis equality-of-populations rank test
+----------------------------+
| f1dpiq~r | Obs | Rank sum |
|----------+-----+-----------|
| 1 | 972 | 472878.00 |
| 2 | 981 | 1.44e+06 |
| 3 | 960 | 2.34e+06 |
| 4 | 966 | 3.28e+06 |
+----------------------------+
chi2(3) = 3635.579
Prob = 0.0001
chi2(3) with ties = 3635.609
Prob = 0.0001
return list
scalars:
r(chi2_adj) = 3635.609319306581
r(df) = 3
r(chi2) = 3635.579049760407
There is no scalar for the p-value. Is there a way to add the statistical significance to the table if it does not appear as a scalar? Thank you so much for your help.
Magda
This is my first post in the community (and also learning how to use Stata), so I hope I manage to follow all the rules. I am using the commands "table" and "collect" to build a table in Stata 17. According to a webinar on the topic presented by Chuck Huber (and hoping that I understood it correctly), to add the results of tests (like p-values), one runs the command for the test and then runs "return list" like in the following example:
ttest age, by(highbp)
return list
After this, appears a list of scalars that can be added to the table. My problem is that I need to add the p-value of a Kruskal_Wallis test and when I run "return list," I only obtain the following scalars:
kwallis f1dpi, by(f1dpiquar)
Kruskal–Wallis equality-of-populations rank test
+----------------------------+
| f1dpiq~r | Obs | Rank sum |
|----------+-----+-----------|
| 1 | 972 | 472878.00 |
| 2 | 981 | 1.44e+06 |
| 3 | 960 | 2.34e+06 |
| 4 | 966 | 3.28e+06 |
+----------------------------+
chi2(3) = 3635.579
Prob = 0.0001
chi2(3) with ties = 3635.609
Prob = 0.0001
return list
scalars:
r(chi2_adj) = 3635.609319306581
r(df) = 3
r(chi2) = 3635.579049760407
There is no scalar for the p-value. Is there a way to add the statistical significance to the table if it does not appear as a scalar? Thank you so much for your help.
Magda
Comment