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
Datepart/ClockpartHi everyone In my dataset I have a time variable. It is in format: %tcDay_Mon_DD_HH:MM:SS_CCYY (this…
PPML with unbalanced panel data, gaps in data, and data asymmetriesI wish to use ppml to estimate a structural gravity model for the years 2000-2016, for ~ 130 countri…
Different models for different hypotheses?Dear all, I have been testing the hypotheses for my master thesis and I have run into a problem. For…
From string date "DD/MM/YYYY" to month and year variablesHi, How can I convert strings like "01/03/1997", e.i. of type "DD/MM/YYYY", to a new numeric variab…
Generate surrounding observations based on observations of another variableHi there, I am trying to create new observations of a variable based on the observations of other v…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting a dataset into multiple datasets
Post a Comment