First, a mea culpa - I'm a mechanical engineer turned physician with a research niche in medical data sciences. I've picked up C, Java, Matlab and python along the way, but never had to use STATA until today. I promise I''m trying to learn, but I have a very specific need and would really appreciate a spring board to build off of, and I imagine this would be very easy for someone familiar with STATA.
I am recently working with the NHAMCS dataset. I've done all my data extraction/analysis in matlab thus far (familiar, convenient, more advanced higher math/machine learning tools). As a final step to result output I need to generate mean and CI for the data. Because of the NHAMCS study design, I'm forced into using a statistical software (like STATA) to make use of the ultimate cluster design option. Per NHAMCS documentation:
The pweight (PATWT), strata (CSTRATM), and PSU (CPSUM) are set with the svyset command as follows:
Stata 8:
svyset [pweight=patwt], psu(cpsum) strata(cstratm)
Stata 9 and later:
svyset cpsum [pweight=patwt], strata(cstratm)
I can create any data array to pass into STATA (variable array of interest i.e. age, PATWT, CSTRATM, CPSUM, whatever else is needed). So what is the bare minimum of code I would need to generate an output of the mean and 95% confidence interval for a given variable array?
Thank you all so much in advance
I am recently working with the NHAMCS dataset. I've done all my data extraction/analysis in matlab thus far (familiar, convenient, more advanced higher math/machine learning tools). As a final step to result output I need to generate mean and CI for the data. Because of the NHAMCS study design, I'm forced into using a statistical software (like STATA) to make use of the ultimate cluster design option. Per NHAMCS documentation:
The pweight (PATWT), strata (CSTRATM), and PSU (CPSUM) are set with the svyset command as follows:
Stata 8:
svyset [pweight=patwt], psu(cpsum) strata(cstratm)
Stata 9 and later:
svyset cpsum [pweight=patwt], strata(cstratm)
I can create any data array to pass into STATA (variable array of interest i.e. age, PATWT, CSTRATM, CPSUM, whatever else is needed). So what is the bare minimum of code I would need to generate an output of the mean and 95% confidence interval for a given variable array?
Thank you all so much in advance
Comment