Hello
Can someone help me create a dataset from my current dataset?
I have the following dataset:
Hospital | Therapy | var3 | var4 | var5 | Estimate_Therapy1 | Estimate_Therapy2 | Estimate_Therapy3 | Estimate_Therapy4
1 | 1 | 3 | 3 | 7 | 0.1 | . | . | .
1 | 2 | 3 | 3 | 7 | . | 0.3 | . | .
1 | 4 | 3 | 3 | 7 | . | . | . | 0.2
2 | 1 | 3 | 3 | 7 | 0.6 | . | . | .
2 | 2 | 3 | 3 | 7 | . | -0.2 | . | .
3 | 1 | 3 | 3 | 7 | 0.1 | . | . | .
3 | 2 | 3 | 3 | 7 | . | 0.3 | . | .
3 | 3 | 3 | 3 | 7 | . | . | -0.2 | .
3 | 4 | 3 | 3 | 7 | . | . | . | 0.2
And I would like to create the following 2 versions and export to excel:
# with all therapies (missing data)
Hospital | Estimate_Therapy1 | Estimate_Therapy2 | Estimate_Therapy3 | Estimate_Therapy4
1 | 0.1 | 0.3 | . | 0.2
2 | 0.6 | -0.2 | . | .
3 | 0.1 | 0.3 | -0.2 | 0.2
# with only those therapies used in all hospitals (no missing data)
Hospital | Estimate_Therapy1 | Estimate_Therapy2
1 | 0.1 | 0.3
2 | 0.6 | -0.2
3 | 0.1 | 0.3
Many thanks in advance!
Related Posts with Create a dataset from the current dataset
Issues selecting correct functional form for multiple regressionHi all, I have been asked to verify the effect of water and sanitation on the mortality of children…
Percentage point function of skew t distributionDear all, I am using the command skewtreg from SJ to fit a skew t distribution. Subsequently, I run…
How to code my independent and dependent variable in an IV strategy with an intensity-of-treatment effectHello, I want to use an IV strategy to estimate the effect of an electrification policy on female l…
Time series dataHi everyone, I am new to STATA so I am sorry if this is a silly question. I am researching oil price…
problem unbalanced panel data for threshold modelsDear all i'm working on pay PHD thesis and i will use the threshold model but ,unfortunately, i can…
Subscribe to:
Post Comments (Atom)
0 Response to Create a dataset from the current dataset
Post a Comment