Announcement

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

  • Using adjustrcspline after mixed

    Hi!
    I want to graph the results after having run a linear mixed model for repeated measures that includes cubic splines for age. I have done:
    Code:
    mkspline2 agespline = age, cubic knots(0 18 36 60 84 96)
    mixed bmi agespline* cov1 cov2 ....... || ID: age, mle cov(un) residuals(exp, t(time))
    adjustrcspline, link(identity)
    However, I get the following message:
    variable _cons not found

    What should I do to overcome this "problem"?

    Kjell Weyde

  • #2
    Dear all,

    I have a similar question.
    I hope that someone who knows
    adjustrcspline could help or give any hint.


    I am trying to model age-period-cohort models for beverage preferences, e.g. beer, wine, spirits. The indicator is the percentage of alcohol intake of a beverage from total alcohol intake in the last 30 days. Therefore, the dependent variable beverage preference is on a percentage scale (and cannot be transformed into an 0/1-variable).

    Since percentages are only values between 0% and 100% (or 0 and 1), it is recommended e.g. using tobit regression models (regression for censored data) or beta regression models.


    For these age-period-cohort models, one approach uses generalized additive models based on cubic splines for the age variable. That’s why I am using (1) mkspline2, (2) tobit or betareg and, finally, (3) adjustrcspline. But I always get an error from adjustrcspline: variable _cons not found.

    I could not find any solution or hints in Stata help or in Statalist that might be helpful to solve this problem.

    Do you have any idea why adjustrcspline does not work with e.g. tobit or beta regression, although in the regression output _cons were calculated and in the e(b) container values for _cons could be found?


    Thanks in advance,

    Nicki Seitz

    (using Stata 14.1 for Windows)


    Syntax (without any other covariates like period or cohort):

    Code:
    mkspline2  _Sage_new2 = age_new, cubic nknots(5) di
    
    tobit beer c._Sage_new2?, ul (101)
    
    adjustrcspline, link(identity)



    Code:
    mkspline2  _Sage_new2 = age_new, cubic nknots(5) di
    
    betareg beer _new c._Sage_new2?
    
    adjustrcspline, link(logit)
    Last edited by Nicki Seitz; 27 Feb 2019, 07:05.

    Comment

    Working...
    X