I need helping modelling this data over stata. Im finding it difficult creating dummy for those that Matched, Ontario, and CdnBorn. Help would be appreciated.
-
Login or Register
- Log in with
clear * input byte(matched immigrant ontario) int count 0 0 0 2660 // `=7660 - 5000' 0 0 1 2445 // `=4425 - 1980' 0 1 0 3295 // `=4455 - 1160' 0 1 1 3710 // `=5040 - 1330' 1 0 0 5000 1 0 1 1980 1 1 0 1160 1 1 1 1330 end label define Immigrant 0 CdnBorn 1 Immigrant label values immigrant Immigrant label define Ontario 0 "Rest of Canada" 1 Ontario label values ontario Ontario label define Matched 0 Unmatched 1 Matched label values matched Matched tabulate matched immigrant if !ontario [fweight=count] tabulate matched immigrant if ontario [fweight=count] exit
clear * input byte(matched immigrant ontario) int count 0 0 0 2660 // `=7660 - 5000' 0 0 1 2445 // `=4425 - 1980' 0 1 0 3295 // `=4455 - 1160' 0 1 1 3710 // `=5040 - 1330' 1 0 0 5000 1 0 1 1980 1 1 0 1160 1 1 1 1330 end label define Immigrant 0 CdnBorn 1 Immigrant label values immigrant Immigrant label define Ontario 0 "Rest of Canada" 1 Ontario label values ontario Ontario label define Matched 0 Unmatched 1 Matched label values matched Matched tabulate matched immigrant if !ontario [fweight=count] tabulate matched immigrant if ontario [fweight=count] exit
glm matched i.immigrant##i.ontario [fweight=count], family(binomial) link(identity)
Comment