You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to build a linear mixed model with fixed var components.
variance components = 5 and 10 (experimental error and sampling error, respectively)
But looks like the var components can not be passed to the model. How to fix it? thank you.
UserWarning: Argument params not used by MixedLM.fit
warnings.warn("Argument %s not used by MixedLM.fit" % x)
Code Sample, a copy-pastable example if possible
formula = 'y ~ trt'
# Fit the model
model = smf.mixedlm(formula, data, groups=data['rep'])
# Fix the variance components
vcov = {'rep: Intercept': 10, 'Residual': 5}
# Create a MixedLMParams object with fixed variance components
params = sm.regression.mixed_linear_model.MixedLMParams.from_components(vcomp=vcov)
# Fit the model with fixed variance components
model_fix = model.fit(params=params, method='lbfgs')
# Print a summary of the model results
print(model_fix.summary())
The text was updated successfully, but these errors were encountered:
JJ-Zhang-DS
changed the title
how to fix linear mixed model with a fixed variance component
how to use linear mixed model with a fixed variance component
Mar 2, 2023
JJ-Zhang-DS
changed the title
how to use linear mixed model with a fixed variance component
how to fit linear mixed model with a fixed variance component
Mar 2, 2023
Describe the bug
I want to build a linear mixed model with fixed var components.
variance components = 5 and 10 (experimental error and sampling error, respectively)
But looks like the var components can not be passed to the model. How to fix it? thank you.
UserWarning: Argument params not used by MixedLM.fit
warnings.warn("Argument %s not used by MixedLM.fit" % x)
Code Sample, a copy-pastable example if possible
The text was updated successfully, but these errors were encountered: