I am trying to predict the dependent variable of a GAMLSS function based on predicted values of mu, sigma, nu and tau parameters.
I have built a model for hospital length of stay using GAMLSS.
After training the model in a sample of patients (using BCPE) I am now trying to predict the dependent variable (length of stay) in a new dataset.
Using the "predictAll" function of the gamlss package in R I can obtain the predicted parameters for mu, sigma, nu and tau, but I don't know how can I obtain the values of the dependent variable (length of stay).
Someone can help? Thanks
predictAllgives you the predicted mu, sigma, nu and tau for BCPE for each new case (i.e. each new set of explanatory variable values).Hence for a new case the predicted distribution of Y (length of stay) is
Y ~ BCPE(mu,sigma,nu,tau)From this predicted distribution you can find the predicted median m
m <- qBCPE(0.5,mu,sigma,nu,tau)or any p quantile of Y
q <- qBCPE(p,mu,sigma,nu,tau)or the probability p2 that Y>c
p2 <- 1 - pBCPE(c,mu,sigma,nu,tau)