I am trying to calculate age count.. please let me know if the below command is correct..
bys ScheduleNo: egen Age_0_14 = count(B2Q1) if Age<=14
bys ScheduleNo: egen count_Age_0_14= max(Age_0_14)
bys ScheduleNo: egen Age_15_24 = count(B2Q1) if Age>=15 & Age<=24
bys ScheduleNo: egen count_Age_15_24= max(Age_15_24)
bys ScheduleNo: egen Age_25_34 = count(B2Q1) if Age>=25 & Age<=34
bys ScheduleNo: egen count_Age_25_34= max(Age_25_34)
bys ScheduleNo: egen Age_35_44 = count((B2Q1)) if Age>=35 & Age<=44
bys ScheduleNo: egen count_Age_35_44= max(Age_35_44)
bys ScheduleNo: egen Age_45_59 = count(B2Q1) if Age>=45& Age<=59
bys ScheduleNo: egen count_Age_45_59= max(Age_45_59)
bys ScheduleNo: egen Age_60_120 = count(B2Q1) if Age>=60& Age<=120
bys ScheduleNo: egen count_Age_60_120= max(Age_60_120)
recode count_* (.= 0)
Related Posts with how to calculate age count..
Help with mlogitHi everyone, I am exploiting a multinomial logit model to study the probability of workers of belong…
Storing cell proportions of survey dataHello, I am trying to store cell proportions using: Code: svy: tab gender2 symptoms, row matcell(c…
Dominance Analysis Command for Multilevel Zero-Inflated Negative Binomial RegressionDear everyone, Could anyone assist with the Stata command for performing a dominance analysis on a …
Grouping string values together to create a new variableHi there, I'm very new to Stata and I'm doing some research on regional inequalities in Europe. My …
panel data - averages in new groupHi I have a large data set with 9 different balance sheet variables for 57 Companies, over ca. 16 y…
Subscribe to:
Post Comments (Atom)
0 Response to how to calculate age count..
Post a Comment