Hey all,
Newish to STATA - longtime SAS user - sorry for the basic question. I have a dataset of cases and controls. Trying to split them into two datasets based on the value of the variable casecontrol. It would be something like this in SAS:
data cases controls; set have;
if casecontrol=1 then output cases;
if casecontrol=2 then output controls;
run;
I guess I am confused since we dont have to specify datasets in STATA - so it seems like if I keep cases - then I lose the controls?
Am I missing something?
Thanks!
nick
Related Posts with Splitting a dataset into multiple datasets
How to identify when a treatment switches between 0 and 1 multiple time in the sample periodDear All ! I have a panel of states. In my data set, I have a dummy variable (treat) such that: trea…
Testing mediation model in stata when the dependent variable is multinomialHi all, I am testing a mediation model. I want to calculate the direct and indirect effects of the …
Plotting logistic regression with triple interactionDear all, I ran a logistic regression with a triple interaction for three independent and dichotomo…
Standard Deviation CodeHi I plan t analyzed the data from ELISA using Stata. The data contain OD_1 and OD_2. OD_1 and OD_1 …
panel var _are the lags and D.variable working same?Dear members, I am struggling in modeling a panel data with lag variables in Stata. I would like so…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting a dataset into multiple datasets
Post a Comment