Hi!
I am quite new to Stata so there may be some basic elements that I have not learnt yet. I have some knowledge of Python programming from before, but quite limited. With that said, this is my issue at hand: I do not want to manually copy paste results from Stata (such a waste of time!) and the export function in Stata seems to not cover all areas. So far, I have mainly used the command putexcel to export rscalars, but not many values are saved as such.
In practise, this is what I want to do. At this point I am not doing anything fancy, just looking at baseline data. I need to get a lot of descriptives (mean etc), run basic tests and I want to do a nice summary to 1. get a good over-view and 2. present to others. And I am using excel/word.
1. I use e.g. the command tabmore to get mean and confidence intervals. After each tabmore I want to export mean and confidence interval to excel and I do not want to manually copy paste. How can I do this??
2. I do e.g. ANOVA tests and quite a lot of them. The test value is stored as an rscalar, but not the p-value. How can I export the p-value??
3. I use tabulate to run Ch2 test. The test value and p-value are saved as rscalars and can be exported. But I also want the number/proportion of observations in each subgroup. How can I export those?
4. An extra question: At this point I have not found how to do a loop to go through different variables. So in order to not having to write all commands I write the code in excel where I can change from one variable to another using links and then copy it all into a do file. Is there a loop that can do this in Stata? I have only found loops that go through a series of numbers, like from 1 to 10, not through a list of variables.
Any ideas? Thank you!
I am quite new to Stata so there may be some basic elements that I have not learnt yet. I have some knowledge of Python programming from before, but quite limited. With that said, this is my issue at hand: I do not want to manually copy paste results from Stata (such a waste of time!) and the export function in Stata seems to not cover all areas. So far, I have mainly used the command putexcel to export rscalars, but not many values are saved as such.
In practise, this is what I want to do. At this point I am not doing anything fancy, just looking at baseline data. I need to get a lot of descriptives (mean etc), run basic tests and I want to do a nice summary to 1. get a good over-view and 2. present to others. And I am using excel/word.
1. I use e.g. the command tabmore to get mean and confidence intervals. After each tabmore I want to export mean and confidence interval to excel and I do not want to manually copy paste. How can I do this??
2. I do e.g. ANOVA tests and quite a lot of them. The test value is stored as an rscalar, but not the p-value. How can I export the p-value??
3. I use tabulate to run Ch2 test. The test value and p-value are saved as rscalars and can be exported. But I also want the number/proportion of observations in each subgroup. How can I export those?
4. An extra question: At this point I have not found how to do a loop to go through different variables. So in order to not having to write all commands I write the code in excel where I can change from one variable to another using links and then copy it all into a do file. Is there a loop that can do this in Stata? I have only found loops that go through a series of numbers, like from 1 to 10, not through a list of variables.
Any ideas? Thank you!
Comment