Hi
I have a dataset of 2017 observations equalling hospital admissions in 2015. Some admissions are the same patient being hospitalized more than once, therefore the dataset includes a variable of a patient identification number. I would like to describe the group of patients by age gender and civilstatus. When I do this I do not want patients who are hospitalized more than once to figure several times. I have tried to use the command "reshape wide" but I have some problems:
Data long -> wide
-----------------------------------------------------------------------------
Number of obs. 2070 -> 1691
Number of variables 5 -> 6211
j variable (2070 values) contactid -> (dropped)
xij variables:
civilstatus -> civilstatus318142 civilstatus320197 ... civilstatus10763667
gender -> gender318142 gender320197 ... gender10763667
age -> age318142 age320197 ... age10763667
Stata is telling me that I have exceeded my maxvar on 5000
I am not sure what I am doing wrong...
I have made the following dataset as an example:
input long patient_id contact_id civilstatus gender age
1124 1054758 3 1 58
1124 1067050 3 1 58
1264 5679291 2 1 77
1600 5758910 2 2 46
519 1224024 1 2 77
519 9833793 1 2 77
end
label define civilstatus 1 "Married" 2 "Unmarried" 3"Divorced"
label values civilstatus civilstatus
label define gender 1 "Female" 2 "Male"
label values gender gender
I have a dataset of 2017 observations equalling hospital admissions in 2015. Some admissions are the same patient being hospitalized more than once, therefore the dataset includes a variable of a patient identification number. I would like to describe the group of patients by age gender and civilstatus. When I do this I do not want patients who are hospitalized more than once to figure several times. I have tried to use the command "reshape wide" but I have some problems:
Data long -> wide
-----------------------------------------------------------------------------
Number of obs. 2070 -> 1691
Number of variables 5 -> 6211
j variable (2070 values) contactid -> (dropped)
xij variables:
civilstatus -> civilstatus318142 civilstatus320197 ... civilstatus10763667
gender -> gender318142 gender320197 ... gender10763667
age -> age318142 age320197 ... age10763667
Stata is telling me that I have exceeded my maxvar on 5000
I am not sure what I am doing wrong...
I have made the following dataset as an example:
input long patient_id contact_id civilstatus gender age
1124 1054758 3 1 58
1124 1067050 3 1 58
1264 5679291 2 1 77
1600 5758910 2 2 46
519 1224024 1 2 77
519 9833793 1 2 77
end
label define civilstatus 1 "Married" 2 "Unmarried" 3"Divorced"
label values civilstatus civilstatus
label define gender 1 "Female" 2 "Male"
label values gender gender
Comment