start_value_rho {itsadug} | R Documentation |
Extract the Lag 1 value from the ACF of the residuals of a gam, bam, lm, lmer model, ...
Description
Wrapper around acf_plot
for regression models.
Usage
start_value_rho(model, plot = FALSE, lag = 2, main = NULL, ...)
Arguments
model |
A regression model generated by |
plot |
Logical: whether or not to produce plot. Default is TRUE. |
lag |
Numeric value, indicating the lag. Default is 2. |
main |
Text string, title of ACF plot. |
... |
Other arguments for plotting the acf, see
|
Value
The autocorrelation value of data points with the data points
at lag lag
.
Author(s)
Jacolien van Rij
See Also
Use acf
for the original ACF function,
and acf_plot
, or acf_resid
.
Other functions for model criticism:
acf_n_plots()
,
acf_plot()
,
acf_resid()
,
derive_timeseries()
,
resid_gam()
,
start_event()
Examples
data(simdat)
# add missing values to simdat:
simdat[sample(nrow(simdat), 15),]$Y <- NA
## Not run:
# Run GAMM model:
m1 <- bam(Y ~ te(Time, Trial)+s(Subject, bs='re'), data=simdat)
# No plotting:
start_value_rho(m1)
# With plot:
rhom1 <- start_value_rho(m1, plot=TRUE)
## End(Not run)
# see the vignette for examples:
vignette('acf', package='itsadug')
[Package itsadug version 2.4.1 Index]