Error regarding running a GLM analyses
Afficher commentaires plus anciens
Hi, I am trying to run a GLM analyses, and I get the following errors after running this model: Some more information: demADHD is the primary dataset of demographics (5x36 double matrix), ADHD_GSR (the dependent variable) is a 119x36 double matrix, ADHDage is a 1x36 double matrix, ADHDVIQ is a 1x36 double matrix, and ADHDmeanFD is a 1x36 double matrix.
modelspec = 'ADHD_GSR ~ ADHDage + ADHDVIQ + ADHDmeanFD'; %set up ADHD GSR GLM model
mdl = fitglm(demADHD,modelspec,'Distribution', 'Normal')
When I run the code, I get the following errors:
Error using classreg.regr.FitObject/assignData (line 134)
Predictor and response variables must have the same length.
Error in classreg.regr.TermsRegression/assignData (line 245)
model = assignData@classreg.regr.ParametricRegression(model,X,y,w,asCat,varNames,excl);
Error in GeneralizedLinearModel/assignData (line 507)
model = assignData@classreg.regr.TermsRegression(model,X,y,w,asCat,dummyCoding,varNames,excl);
Error in GeneralizedLinearModel.fit (line 882)
model =
assignData(model,X,y,weights,offset,binomN,asCatVar,dummyCoding,model.Formula.VariableNames,exclude);
Error in fitglm (line 146)
model = GeneralizedLinearModel.fit(X,varargin{:});
How do I go about fixing these errors? The odd thing is that I followed the GLM example in the 'help' page on here, and it is structured in the exact same format - yet mine throws back these errors. But I'm not sure where in my model the mistake is. Thank you!
Réponses (0)
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!