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?
Generate New VariableHello, Can somebody help me create a dummy variable? I want to create a variable that is =1 if a re…
How to predict constant from fixed-effect model?Hi, Statalist: I have a coding problem regarding predicting constant from the fixed-effect regress…
Graph modification: How to modify a line to a "bracket-line", change text to italic and insert character ?Attempting to modify the following graph- 3 questions: 1) Would like to change some of graph text t…
Equation has been stored but it is not found to perform testCould anyone explain to me how to solve this issue? I have run a regression and stored it but I can…
How can I select more than one minimum for each respondentHello Statalist. I have a dataset that looks like this: pid value number 1 0.12 2 1 0.4 2 …
Subscribe to:
Post Comments (Atom)
0 Response to Help!How could I draw a restricted cubic spline using linear regression?
Post a Comment