Hello good people of statalist,
A fairly basic question here on menl. I am new to the world of menl and related syntax. My problem is as follows: I have three variables id (assays 1-13), time (months 1-24), and outcome (the concentration of a chemical in the assay). The data at each time point is unbalanced across ids (i.e., there is not an outcome for all months across all assays).
I would like to be able to fit a nonlinear curve to my data , and then pull the nutrient content at different time points from the curve, preferably using the margins, although perhaps predict after the model would be sufficient here. My code and output is as below:
The above is my basic model. However, when I use predict:
This gives me predicted values for each id, not each time point. When, after fitting the model, I use:
I get an error "variable 'time' not found in list of covariates".
What am I doing wrong here in my equation that I cannot get predicted outcome values for different time points here.
Any help is very much appreciated.
Best,
John.
A fairly basic question here on menl. I am new to the world of menl and related syntax. My problem is as follows: I have three variables id (assays 1-13), time (months 1-24), and outcome (the concentration of a chemical in the assay). The data at each time point is unbalanced across ids (i.e., there is not an outcome for all months across all assays).
I would like to be able to fit a nonlinear curve to my data , and then pull the nutrient content at different time points from the curve, preferably using the margins, although perhaps predict after the model would be sufficient here. My code and output is as below:
Code:
menl outcome = ({b1}+{U[id]})/(1+exp(-(time-{b2})/{b3}))
Code:
predict fitoutcome, yhat
Code:
margins, at( time = (1(1)24)) asbalanced
What am I doing wrong here in my equation that I cannot get predicted outcome values for different time points here.
Any help is very much appreciated.
Best,
John.