View source: R/SpecModel-generators.R
NormalFixed | R Documentation |
Specify a model of the form
y_i = N(mean[i], sd[i])
or
y_i = N(exposure[i] * mean[i], sd[i])
.
NormalFixed(mean, sd, useExpose = TRUE)
mean |
An object of class |
sd |
The standard deviation of the means. |
useExpose |
Whether the model includes an
exposure term. Defaults to |
Among other things, the model is useful as a data model for
surveys. In such cases, exposure
represents the
true underlying counts, mean
represents coverage rates,
sd
represents standard errors for the coverage rates,
and y
represents the observered counts. If the model
is being used to represent a census post-enumeration survey,
for instance, then exposure
would be the true population,
mean
the coverage rates as estimated from the survey,
se
the survey-based standard errors, and y
the
census counts.
Subscript i
denotes a cell within a classification
defined by variables such as age, sex, and time.
For instance cell i
might be 30-34 year old females
in 2020.
An object of class SpecLikelihoodNormalFixed
.
NormalFixed
is typically used as
part of a call to function Model
.
More flexible normal models can be specified using
Normal
.
mean <- Values(array(c(0.95, 0.96, 0.95, 0.94),
dim = c(2, 2),
dimnames = list(age = c("0-39", "40+"),
sex = c("Female", "Male"))))
sd <- Values(array(c(0.05, 0.08, 0.05, 0.04),
dim = c(2, 2),
dimnames = list(age = c("0-39", "40+"),
sex = c("Female", "Male"))))
NormalFixed(mean = mean, sd = sd)
NormalFixed(mean = mean, sd = 0.1)
NormalFixed(mean = mean, sd = 0.1, useExpose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.