Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exporting n and p-values Into Excel for Patient Characteristics Table

    Hi,

    I am running chi2 and fisher's exact tests on Stata 15.1, then manually typing the resulting n and p-values into excel to create my patient characteristics table. I saw that some people found ways to export p-values from logistic regressions and t-test results directly into excel using loops, and was wondering if I could do the same.

    After importing "database.dta", I run the following tabulation code for each pair of variables, to fill the table below. I have two excel spreadsheets, one named "nvalues" and one named "pvalues".

    tabulate exposure1 characteristic1 if condition1!=. & condition2!=., chi2 exact row col
    condition1 and 2 are the same for every tabulation, and there is no pattern in the naming of exposures/outcomes/characteristic variables.
    Patient Characteristics yes for exposure1 no for exposure1 yes for outcome2 no for outcome2
    characteristic1 p or n-values p or n-values p or n-values p or n-values
    characteristic2 p or n-values p or n-values p or n-values p or n-values
    Any advice would be greatly appreciated!

    Thanks,
    Priscilla

Working...
X