modeledf {itsadug}R Documentation

Retrieve the degrees of freedom specified in the model.

Description

Retrieve the degrees of freedom specified in the model.

Usage

modeledf(model)

Arguments

model

A fitted regression model (using gam, or bam).

Value

Numeric value: degrees of freedom specified in the model.

See Also

Other Utility functions: convertNonAlphanumeric(), corfit(), diff_terms(), find_difference(), missing_est(), observations(), print_summary(), refLevels(), res_df(), summary_data(), timeBins()

Examples

data(simdat)

## Not run: 
# models take somewhat longer time to run:

# Fit simple GAM model:
gam1 <- bam(Y ~ s(Time), data=simdat, discrete=TRUE)
modeledf(gam1)
gam2 <- bam(Y ~ s(Time)+s(Time, Subject, bs='fs', m=1), 
    data=simdat, discrete=TRUE)
modeledf(gam2)
gam3 <- bam(Y ~ Subject+s(Time, by=Subject), 
    data=simdat, discrete=TRUE)
modeledf(gam3)
gam4 <- bam(Y ~ Group+s(Time)+s(Time, Subject, bs='fs', m=1), 
    data=simdat, discrete=TRUE)
modeledf(gam4) 
gam5 <- bam(Y ~ Group+s(Time, by=Group)+s(Time, Subject, bs='fs', m=1), 
    data=simdat, discrete=TRUE)
modeledf(gam5) 

# Fit a gamm:
gam6 <- gamm(Y ~ Group+s(Time), random=list(Subject=~1) data=simdat, discrete=TRUE)
# this produces an error...
modeledf(gam6)
# ... but this works:
modeledf(gam6$gam)

## End(Not run)


[Package itsadug version 2.4.1 Index]