Announcement

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

  • mfp xpowers

    Hi

    I'm trying to limit the powers fitted to some of my variables in a multivariable fractional polynomial, but the procedure doesn't seem to do what I want it to!?

    I have 6,300 observations, with 5 predictors recorded for each. The dependent variable is a count of deaths within each population decile (10% of a population), and I have an offset of the population size for that decile. Post and country are binary 0/1 variables, decile has values 1-10, and age group has values 1-15. There are observations for 21 years.

    I've created some interactions between the predictor variables (indicated by var1_var2) and it is the powers selected for some of the interactions which I want to limit.
    From discussion with my supervisor, we believe that fp power(s) chosen for the year variable should be used for all interactions with year.

    The original model is:
    mfp, alpha(0.05) select(0.05, post_country country_year post_country_year country:1): nbreg d_deaths agegrp post country year post_country post_year country_year post_country_year decile_scot decile_eng decile_post decile_year, offset(lpop)

    The mfp procedure returns that year is best modelled with a fp of 2 (so year squared). The interactions with year are all returned as linear. So I need the interactions with year (post_year, country_year, post_country_year and decile_year) to be fitted as squared terms.

    From my understanding of the mfp help file, it should be as simple as specifiying the year interactions in the xpowers option with the same fp transformations as year (so 2).

    mfp, alpha(0.05) select(0.05, post_country country_year post_country_year country:1) xpowers(post_year country_year post_country_year decile_year:2): nbreg d_deaths agegrp post country year post_country post_year country_year post_country_year decile_scot decile_eng decile_post decile_year, offset(lpop)

    However, when I fit this, the mfp output still returns the _year interactions as linear terms. This remains even if I fit the model using the menu, rather than through a do script. I have also tried limiting the df option for these interactions, but they are still fitted as linear.

    I've considered simply fitting a nbreg model, manually transforming the data with the suggested fp transformations, but I need the plotting abilities of the mfp command.


    I'm using Stata 13.1.

    Any help or suggestions would be greatly appreciated!!
Working...
X