I am working on a project using linear regression and I want to draw a restricted cubic spline for regression coefficient.And I only get a OR using the following code:
svyset sdmvpsu [pw = wtmec8yr], strata( sdmvstra ) singleunit(centered)
centile lbxgly if eligible==1, centile(1,99)
drop if lbxgly <= 9.84 | lbxgly >= 213
generate lbxgly1 = round( lbxgly ) if eligible==1
_pctile lbxgly1, p(10 50 90)
return list
mkspline fibers = lbxgly1, knots(25 47 104) cubic
xi: svy: regress cell_length fibers1 fibers2 i.age i.riagendr /*
*/i.race i.edu i.income i.smoke i.drink i.diabetes i.chole i.waist
testparm fibers2
testparm fibers2 fibers1
capture drop pa or lb ub
levelsof lbxgly1, local(level)
xblc fibers1-fibers2, covname(lbxgly1) at(`r(levels)') > reference(9) eform generate(pa ors lbs ubs)
twoway (line lbs ubs ors pa , sort lc(black black black) lp(- -)) , legend(off) xlabel(0(50)320) ylabel(0.1(0.1)1.3, angle(horiz) format( %2.1fc)) ytitle("beta") xtitle("lbxgly, g/day") name(f1,replace)
Related Posts with Help!How could I draw a restricted cubic spline using linear regression?
Disable variable expansionHi, it happens the following, I write for example: Code: use "db.dta" [...] gen year = start + de…
Could you please help with coding "mixed-effects model"?I'd like to ask for advice on coding the "mixed-effects model" to see the percent change in health b…
Instrument variable model in binary outcome panel model with fixed effectsHi there! I am studiyng whether financial literacy causes over-indebtedness among households. So, m…
Could you please help with coding "mixed-effects model"?n/a …
Specify e(title) to feed to etableWith the option `column(title)` etable is supposed to use the model titles as column headers: Code:…
Subscribe to:
Post Comments (Atom)
0 Response to Help!How could I draw a restricted cubic spline using linear regression?
Post a Comment