| getFittedResponse | R Documentation |
Wrapper to get the fitted/predicted values of the model on the same scale as the observed response (getObservedResponse) and the simulations (getSimulations).
getFittedResponse(object, ...)
## Default S3 method:
getFittedResponse(object, ...)
## S3 method for class 'brmsfit'
getFittedResponse(object, ...)
object |
a fitted model. |
... |
additional parameters to be passed on, usually to getFitted. |
For most models, this is identical to getFitted. The exception are binomial and beta-binomial models with more than one trial per observation (k/n models), specified either as cbind(successes, failures) or as proportions with the number of trials provided via weights. For these models, getObservedResponse and getSimulations return the number of successes, whereas getFitted returns the predicted proportions. getFittedResponse returns the predicted proportions multiplied by the number of trials, i.e. the expected number of successes.
The fitted response is used by testDispersion (refit = FALSE) to calculate the raw residuals (observed or simulated response minus fitted response).
getFitted, getObservedResponse, getSimulations
testData = createData(sampleSize = 400, family = gaussian())
fittedModel <- lm(observedResponse ~ Environment1 , data = testData)
# response that was used to fit the model
getObservedResponse(fittedModel)
# predictions of the model for these points
getFitted(fittedModel)
# predictions on the scale of the observed response
# (differs from getFitted only for k/n binomial models)
getFittedResponse(fittedModel)
# extract simulations from the model as matrix
getSimulations(fittedModel, nsim = 2)
# extract simulations from the model for refit (often requires different structure)
x = getSimulations(fittedModel, nsim = 2, type = "refit")
getRefit(fittedModel, x[[1]])
getRefit(fittedModel, getObservedResponse(fittedModel))
# get data frame that was used to fit the model
getData(fittedModel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.