Hi Everyone,
I'm trying to run an analysis on a subpopulation of a sample, but I noticed that after I did these commands my variable's key automatically switched from frequency to proportion:
generate sample =0
replace sample=1 if Eldercarein3months!=.
tab sample
svyset cluster [pw=wt06], strata(strata)
svy, subpop(if sample==1): tab Eldercarein3months
This is a problem because I am hoping to run a chi2 on my variables, but I can't do that with a proportional key. Is there any way I can change it back to frequencies?
Thank you,
Evan
Related Posts with Proportion to Frequency using subpop commands
Data restructuringI have a dataset of patients who had repeat treatments. Unfortunately instead of having a unique pat…
Stata vs Python for data managementStata has the best data management of a single data set (a single data frame) that I have come acros…
Generate new Variable and based on that cumulate by monthHi, I do have a question regarding a dataset. I try to cumulate my "usd" by month for each country.…
Creating a Complicated Variable.Hello all, I have 7 variable all coded 0 = no and 1 = yes. (nothing else). All variables ask if you…
Stata error code: Factor Variables may not contain negative valuesHello, I am very new to Stata - I have tried reading around to solve my error but I am struggling! …
Subscribe to:
Post Comments (Atom)
0 Response to Proportion to Frequency using subpop commands
Post a Comment