my square term is significant for the whole sample but insignificant separately for males and females both, when males and females were regressed separately. what does this mean
-
Login or Register
- Log in with
clear* set obs 10000 gen x = 5-_n/1000 gen ystar = invlogit(x) set seed 1234 gen y = rbinomial(1, ystar) logit y x predict phat_logit label var phat_logit "Logistic Predictions" estat gof, group(10) probit y x predict phat_probit estat gof, group(10) table label var phat_probit "Probit Predictions" graph twoway line phat_* x, sort name(phat_v_x, replace) graph twoway scatter phat_probit phat_logit, name(phats_compared, replace) /// msize(vsmall) || line phat_logit phat_logit
clear* set seed 1234 set obs 200 gen byte group = mod(_n, 2) by group, sort: gen x = _n/10 gen y = 2*x + 1 + rnormal(0, 2.5) if group == 1 replace y = .2*x^2 - x + 1 + rnormal() if group == 0 regress y i.group##c.x##c.x lincom c.x // LINEAR COEFFICIENT IN GROUP 0 lincom c.x#c.x // QUADRATIC COEFFICIENT IN GROUP 0 lincom c.x + 1.group#c.x // LINEAR COEFFICIENT IN GROUP 1 lincom c.x#c.x + 1.group#c.x#c.x // QUADRATIC COEFFICIENT IN GROUP 1 test c.x#c.x 1.group#c.x#c.x // TEST QUADRATIC VS PURE LINEAR MODEL // VERTEX LOCATION IN GROUP 0 nlcom -_b[c.x]/(2*_b[c.x#c.x]) // VERTEX LOCATION IN GROUP 1 nlcom -(_b[c.x ] + _b[1.group#c.x])/(2*(_b[c.x#c.x] + _b[1.group#c.x#c.x])) margins group, at(x = (0(.2)5)) marginsplot
Comment