Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
I'm using MFP command combined with xtgee to model a fractional logistic model (dependent variable is a percent varying from 0 to 100% inclusive; patients are clustered within a doctor). Command is mfp,select(0.05): xtgee actimpair age bmi comorbidities female,
The mfp command creates new transformed age variables (lets call them age1 and age2) based on the fractional polynomial terms it thinks best (and very kindly gives the formula so they are easy to reproduce). I want to run the margins command to give predictions on the dependent variable with 95% CI's across a large range of age values. It looks (to me at least) that I need to program a routine that for every age value needing a prediction:
(4) Compute the 95% CI's for the predictions and store them in the relevant place in the matrix mentioned in (3).
Final tasks after looping through all such ages populating the matrix holding relevant results is to convert the matrix into data and graph from it (this task at least I can do). I don't program often enough to accomplish the steps above quickly. Hopefully some bright public spirited person can do it for me or show how it can be done even more efficiently. Hopefully it might be of use to others as well. I really like this margins command. Any help much appreciated.
Thanks,
Steve
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Nice Margins programming challenge
From
Stephen Kay <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: Nice Margins programming challenge
Date
Fri, 3 Dec 2010 18:09:25 -0000
Title: Nice Margins programming challenge
family(binomial) link(logit)
(1) Generate the appropriate age1 and age2 values
(2) Input these into the margins command using the "at" option
(3) Store/append the resultant prediction plus SE, plus relevant age value into a matrix holding all such results.
DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you.