Im getting an error when running this code for a box cox transformation
Error: mat[i,]<-p number of items to replace is not a multiple of replacement length
mat1<-matrix(Na,101,1)
for (i in 1:length(d4)) {
d<-d4[[i]]
p<-powerTransform(d$DBP)
d$NEWDBP<-bcPower(d$DBP, p$lambda)
results<-shapiro.test(d$NEWDBP)
mat1[i,]<-(results$p.value)
mat[i,]<-p
}
mat1
It is printing the results but giving me this error, the length of the set is 101, what am I doing wrong?