Extract the response of a fitted model
getObservedResponse(object, ...) ## Default S3 method: getObservedResponse(object, ...) ## S3 method for class 'HLfit' getObservedResponse(object, ...)
a fitted model
The purpose of this function is to safely extract the observed response (dependent variable) of the fitted model classes
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) # 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[]) getRefit(fittedModel, getObservedResponse(fittedModel))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.