Hello,
I am trying to generate a regression with mixed effects using the data given below. I have 4 measurements (conc) per person (ID). The "days" variable identify the day from the beginning of pregnancy at which each measurement was conducted.
I need a single regression for each ID. So I thought of this command (I'm using Stata 13 SE):
Is there a way to overcome the problem and calculate the regression with the measurements I have?
Also, how can I save the beta coefficient and the intercept (one per person) in two variables? I've read about the mat and svmat commands, but I end up with 4 variables for the beta coefficient, in which all but the first line is missing, while I couldn't find a way to save the intercept.
Thank you so much for your help!
Elena
I am trying to generate a regression with mixed effects using the data given below. I have 4 measurements (conc) per person (ID). The "days" variable identify the day from the beginning of pregnancy at which each measurement was conducted.
I need a single regression for each ID. So I thought of this command (I'm using Stata 13 SE):
by ID, sort: xtmixed conc days || timepoint:However, I have quite a few missing values and when running the command I get "could not calculate numerical derivatives -- discontinuous region with missing values encountered" (ID 301, and in every other case, even without missing values) and "conc collinear with days _cons" (ID 305), and it stops.
Is there a way to overcome the problem and calculate the regression with the measurements I have?
Also, how can I save the beta coefficient and the intercept (one per person) in two variables? I've read about the mat and svmat commands, but I end up with 4 variables for the beta coefficient, in which all but the first line is missing, while I couldn't find a way to save the intercept.
Thank you so much for your help!
Elena
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int ID byte timepoint int days float conc 301 1 72 24.26 301 2 136 . 301 3 211 22.65 301 4 268 22.39 305 1 48 . 305 2 132 19.21 305 3 228 19.65 305 4 288 . 309 1 87 18.65 309 2 141 20.55 309 3 220 22.2 309 4 274 21.18 319 1 76 21.46 319 2 153 22.2 319 3 223 21.1 319 4 272 19.12 end
Comment