observations | R Documentation |
Number of observations in the model.
observations(model)
model |
A fitted regression model (using gam, bam, (g)lm, (g)lmer). |
Numeric value: number of observations that are considered by the model.
Other Utility functions:
convertNonAlphanumeric()
,
corfit()
,
diff_terms()
,
find_difference()
,
missing_est()
,
modeledf()
,
print_summary()
,
refLevels()
,
res_df()
,
summary_data()
,
timeBins()
data(simdat) # simulate some missing data: simdat[sample(1:nrow(simdat), size=15),]$Y <- NA simdat[sample(1:nrow(simdat), size=7),]$Group <- NA # Fit simple GAM models: gam1 <- bam(Y ~ s(Time), data=simdat, discrete=TRUE) gam2 <- bam(Y ~ Group + s(Time, by=Group), data=simdat, discrete=TRUE) # number of data points in data frame: nrow(simdat) # observations model gam1: observations(gam1) # observations model gam2: observations(gam2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.