modeledf | R Documentation |
Retrieve the degrees of freedom specified in the model.
modeledf(model)
model |
A fitted regression model (using gam, or bam). |
Numeric value: degrees of freedom specified in the model.
Other Utility functions:
convertNonAlphanumeric()
,
corfit()
,
diff_terms()
,
find_difference()
,
missing_est()
,
observations()
,
print_summary()
,
refLevels()
,
res_df()
,
summary_data()
,
timeBins()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.