Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Contour Plot

    I am basically at my wits end with this problem. I'm trying to create a twoway contour plot from a regression model with an interaction. The code seems right (see below). In fact, I had previously used the same code successful to create a beautiful looking contour plot. But now when I run the code on the same data I obtain a partial plot (see below). The color legend to the write is properly produced, but the contour map itself is bereft of any color. I just can figure out what's going on, and I am hoping someone in this forum can help.

    xtreg lggrnprice2 lgconinc2 c.lgconinc2#c.lgpolviews2 lgpolviews2 i.dwelown2 i.hhrace2 male hompop educ_2 lgsize, fe
    quietly margins, at(lgconinc2=(0(0.001)0.004) lgpolviews2=(0(0.2)2.2)) saving(predictions, replace)
    use predictions, clear
    list _at1 _at3 _margin in 1/10
    list _at1 _at3 _margin
    rename _at1 Incomeproportion
    rename _at3 Politicalviews
    rename _margin HighPricesEnv
    list Incomeproportion Politicalviews HighPricesEnv in 1/10
    list Incomeproportion Politicalviews HighPricesEnv
    twoway (contour HighPricesEnv Incomeproportion Politicalviews, ccuts(1(.2)2.2)), xlabel(0(.2)2.2) /*
    */ ylabel(0(0.001)0.004, angle(horizontal)) xtitle("Political views (Lib.-Consv.)") ytitle("Income proportion (2000 PPP)") /*
    */ ztitle("Predicted Willingness to pay higher prices.")
    title("Predicted Willingness to Pay Higher to Proct. Env. by Political Views and Income Proportion")

    Click image for larger version

Name:	Capture.PNG
Views:	2
Size:	46.2 KB
ID:	1702868
    Attached Files
Working...
X