Dear Statalisters
Following multilevel logistic regression, I want to create a plot of predicted margins of the outcome (mmdied) for three different age cohorts on the same chart. The age ranges do not overlap (they are: 20-35; 40-55; 60-75) and I'd like the plot to have separate lines for each. When I use combomarginsplot, it plots age and predictions but joins up the three age lines. Is there anyway to instruct it not to do this? When the age ranges do overlap the combomarginsplot does produce three separate lines and does not attempt to join them. I am using Stata 13, syntax as follows:
melogit mmdied i.cohort mm1 sex##c.age1##c.age1##c.age1 || origpc: || idno:, or
margins if cohort==1, at (age1=(60(1)75)) predict(mu fixedonly) vsquish ///
saving(null_1930, replace)
melogit mmdied i.cohort mm1 sex##c.age1##c.age1##c.age1 || origpc: || idno:, or
margins if cohort==2, at (age1=(40(1)55)) predict(mu fixedonly) vsquish ///
saving(null_1950, replace)
melogit mmdied i.cohort mm1 sex##c.age1##c.age1##c.age1 || origpc: || idno:, or
margins if cohort==3, at (age1=(20(1)35)) predict(mu fixedonly) vsquish ///
saving(null_1970, replace)
combomarginsplot null_1970 null_1950 null_1930, labels ("1970s" "1950s" "1930s") noci ///
Following multilevel logistic regression, I want to create a plot of predicted margins of the outcome (mmdied) for three different age cohorts on the same chart. The age ranges do not overlap (they are: 20-35; 40-55; 60-75) and I'd like the plot to have separate lines for each. When I use combomarginsplot, it plots age and predictions but joins up the three age lines. Is there anyway to instruct it not to do this? When the age ranges do overlap the combomarginsplot does produce three separate lines and does not attempt to join them. I am using Stata 13, syntax as follows:
melogit mmdied i.cohort mm1 sex##c.age1##c.age1##c.age1 || origpc: || idno:, or
margins if cohort==1, at (age1=(60(1)75)) predict(mu fixedonly) vsquish ///
saving(null_1930, replace)
melogit mmdied i.cohort mm1 sex##c.age1##c.age1##c.age1 || origpc: || idno:, or
margins if cohort==2, at (age1=(40(1)55)) predict(mu fixedonly) vsquish ///
saving(null_1950, replace)
melogit mmdied i.cohort mm1 sex##c.age1##c.age1##c.age1 || origpc: || idno:, or
margins if cohort==3, at (age1=(20(1)35)) predict(mu fixedonly) vsquish ///
saving(null_1970, replace)
combomarginsplot null_1970 null_1950 null_1930, labels ("1970s" "1950s" "1930s") noci ///
Comment