Announcement

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

  • Why the p values from my linear regression model don't agree with the ones from ANOVA?

    Click image for larger version

Name:	WeChat Image_20181208235753.png
Views:	1
Size:	60.6 KB
ID:	1474039

    Click image for larger version

Name:	WeChat Image_20181208235746.png
Views:	1
Size:	52.7 KB
ID:	1474040




    Hi everyone, here I'm confused: I think ANOVA and Linear Regression Model are supposed to be the same thing, but I got different p values from ANOVA and LRM. The effect size (from ANOVA) and the coefficient (from LRM) are identical, but p values for some variables (e.g. the Black/What gap) are different. I'm wondering what's going on?
    Last edited by Yuan Chang; 08 Dec 2018, 22:08.

  • #2
    You might want to read up on what nestreg is doing. In the meantime, try the following and see whether it helps.
    Code:
    version 15.1
    
    clear *
    set seed `=strreverse("1474038")'
    
    quietly sysuse auto
    summarize rep78, meanonly
    quietly replace rep78 = runiformint(`=r(min)', `=r(max)') if mi(rep78)
    
    *
    * Begin here
    *
    regress gear_ratio i.rep78
    testparm i.rep78
    pwcompare i.rep78, mcompare(scheffe)
    
    anova gear_ratio rep78
    pwcompare rep78, mcompare(scheffe)
    
    exit

    Comment

    Working...
    X