Last active
February 5, 2018 19:24
-
-
Save benjamin-chan/bcfaad23dfc8ec735a01dcc4a1ccbfd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
use "C:\Users\chanb\Box Sync\Share\BDPDropIn\Hinson\Simple_GCS.dta" | |
bysort recordid : egen meanGCS = mean(gcs) | |
bysort recordid : egen sdGCS = sd(gcs) | |
bysort recordid : egen countNonMissingGCS = count(gcs) | |
gen group1 = 0 | |
replace group1 = 1 if sdGCS == 0 /* Assign to group1 if all GCS values are the same */ | |
bysort recordid : egen minGCS = min(gcs) /* Calculate minimum GCS */ | |
bysort recordid : gen gcsAtZero = gcs if hourofmeasurement == 0 /* Determine GCS at time 0 */ | |
bysort recordid : egen group2 = max(minGCS == gcsAtZero) /* Assign to group2 if the minimum GCS is the GCS at time 0 */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment