Announcement

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

  • np trend or p of trend

    Hello, I have a problem with "np trend" in adjusted model.
    I want to know the association between the consumption of ultra processed food and macrosomia in children, so I am doing a logistic model
    In the case of macrosomia and consumption of ultra-processed foods, my independent variable is consumption of ultra-processed foods (categorical qualitative, divided in tertile 1, tertile 2, tertile 3), and my dependent variable would be macrosomia (categorical: yes/no). I want to do a np trend for the unadjusted model and for the adjusted model. I know how to do the np trend for the unadjusted model, but I am having problems with the adjusted model because I don't know how to add the covariate such age for example

    This are my commands in Stata description

    xi:logistic macrosomia i.upfterciles (unadjusted model) xi:logistic macrosomia i.upfterciles age (adjusted model)
    np trend macrosomia, by (upfterciles) (np trend for the unadjusted model)

    I don't know how to add age (
    covariate) for the np trend in adjusted model



  • #2
    I assume that you're referring to the official Stata command nptrend. Your syntax for that is incorrect. It's also not clear why you're using the prefix xi:.

    Regardless, in order to get a linear trend component of the association that's suggested by fitting a logistic regression model, you can use contrast postestimation command. Try something like the following.
    Code:
    // Unadjusted
    logit macrosomia i.upfterciles, nolog
    contrast p.upfterciles // Examine the linear component, identified as "(linear)"
    
    // Adjusted
    logit macrosomia i.upfterciles c.age, nolog
    contrast p.upfterciles

    Comment

    Working...
    X