Dear Stata users,
I'm new here and I have a problem which I'm, unfortunately, unable to solve. I'm plotting odds ratios from logistic regression using coefplot (Stata 16.1). Below is my code for the plot:
All of the variables are categorical (except for the "number of siblings" which I treat as continuous) and specific values are labeled. The problem is that the first time I generated a plot using this code, I got:
which is the outcome that I want. However, I made a spelling mistake, so I wanted to correct it. After opening my syntax the next day and running THE SAME code I got:
So it appears that coefplot reads only the label for "numer of siblings" and not for the other variables and it also drops headlines.
I have no idea why it is so. Please help me if you have a clue.
Regards,
Honorata
I'm new here and I have a problem which I'm, unfortunately, unable to solve. I'm plotting odds ratios from logistic regression using coefplot (Stata 16.1). Below is my code for the plot:
Code:
xi: asdoc logit child1 ln_time i.edu_level i.married i.pgemplst i.cohort num_s, cluster(pid) nolog or coefplot, title({bf:Transition to first birth}) subtitle(Odds Ratio) eform drop(ln_time _cons) xlabel(0(1)5) xscale(range(0(1)5)) headings(2.edu_level="{it:Education Level}" 2.married="{it:Marrital Status}" 2.pgemplst="{it:Employment Status}" 2.cohort="{it:Cohort}" num_s=" ") mlabposition(3) mlabgap(*10) mlabsize(3) mlabel(cond(@pval<.01, string(@b,"%9.3f") + "***", cond(@pval<.05, string(@b,"%9.3f") + "**", cond(@pval<.10, string(@b,"%9.3f") + "*", string(@b,"%9.3f"))))) msize(large) legend(off) note("*** p<0.01, ** p<0.05, * p<0.10") graph export first_birth.png, width(1000) replace
which is the outcome that I want. However, I made a spelling mistake, so I wanted to correct it. After opening my syntax the next day and running THE SAME code I got:
So it appears that coefplot reads only the label for "numer of siblings" and not for the other variables and it also drops headlines.
I have no idea why it is so. Please help me if you have a clue.
Regards,
Honorata
Comment