SCnext / SCGLR

An extension of the Fisher Scoring Algorithm to combine PLS regression with GLM estimation in the multivariate context. Covariates can be grouped in themes.
https://scnext.github.io/SCGLR/
1 stars 1 forks source link

Error in apply #19

Open madichpy opened 3 years ago

madichpy commented 3 years ago

Hello I am trying to use SCGLR package for a multivariate analysis that includes 3 dependent variables, 1 categorical dependent variable (burnt and unburnt), and two additional covariates (temperature and humidity), but I get this error when trying to complete the script: Error in apply(x, 2, mean) : dim(X) must have a positive length

Can anyone tell me what is causing this?

I present my script (and its results) below:

build multivariate formula

ny <- c("taxa_pulsos","duracao","energia") nx1 <- c("fogo") nadd <- c("temperatura","umidade") form <- multivariateFormula(ny,nx1,A=nadd) form Multivariate formula taxa_pulsos + duracao + energia ~ fogo | temperatura + umidade Response: Y = taxa_pulsos + duracao + energia Covariates: T1 = fogo A = temperatura + umidade

summary(form) Length1 Length2 Class1 Class2 1 2 MultivariateFormula Formula Class3 Mode formula call

define family

fam <- rep("poisson",length(ny)) genus.scglr <- scglr(formula=form,,data = dados,family=fam) Error in apply(x, 2, mean) : dim(X) must have a positive length