Hello Statalist users,

I am working on a study that assesses the effects of family contact on the number of infractions over a six-month period. Both the main predictor and outcome were gathered from facility records and aggregated to 3 and 6 months. Additionally, I administered surveys to examine parental warmth and other known covariates. Due to missing data, I ran a multiple imputation using MICE to imputethe number of infractions (6-months), family contact (6-months), parental warmth (3- and 6-months), and recidivism risk. I assessed the imputation model against some graphical visuals to see if the proposed model was a good fit. Upon reviewing the data I decided to convert the data to flong and to reshape it into long format so I can run a Hausman test. But I received the "estimation sample variaes between m=1 and m=2" error

Here is the imputation command
HTML Code:
set seed 832016
mi set wide 
mi register imputed infractions6 contact6 pwas1 pwas2 therapy3 therapy6 oyas 
mi impute chained (nbreg) infractions6 (regress) contact6 pwas1 pwas2 (logit) therapy3 therapy6(ologit) oyas = infractions3 contact3 pwas0 age miles length race exitr, add(15) force dots augment

mi convert flong
mi reshape long infractions contact pwas therapy, i(ID) j(time)
And here is the hausman test command to see if I need to use fixed or random effects

HTML Code:
mi xtset ID time
mi estimate, vartable:xtnbreg infractions contact therapy pwas, i(ID) fe
est store fixed
xtnbreg infractions contact therapy pwas age miles race oyas, i(ID) re
est store random
hausman fixed random

Thank you for your willingness to help with this problem.

Roxy