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
Inquire about merge commandHi, I need to merge 3 files. And everytime I need to drop _merge after merge command. Is this the us…
Generate New Variable Only For Certain DataHi all, I tried searching for this and I just can't find the exact answer. It seems like this shoul…
Importing files from MS ExcelDear Stalist, I have three excel files, each with a couple of sheets. Here's a sample of one of the …
How to sum two variables from different observations of the same categoryHello together, I have a data set with companies, which conduct deals. Furthermore, these deals hav…
command to check for overlapping interval?Hello everyone, I'd like to ask for your help in the following issue. I'm using individual data an…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting a dataset into multiple datasets
Post a Comment