saObj: A Constructor for Objects of Class 'sadObj' and 'saeObj'

Description Usage Arguments Value See Also Examples

View source: R/allConstructors.R

Description

Simple wrapper to new("sa[de]Obj"). If missing, it adds an inclusion variable to data; it checks for missing in the clustering variable. Adds comments documenting changes made to the returned object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
saObj(
  data,
  f,
  smallAreaMeans = NULL,
  s1 = NULL,
  s2 = NULL,
  cluster = NULL,
  include = NULL,
  auxiliaryWeights = NULL
)

Arguments

data

See "saeObj".

f

a linear mixed effects formula, but see Value.

smallAreaMeans

See "saeObj".

s1

See "saeObj".

s2

See "saeObj".

cluster

See "saeObj".

include

See "saeObj".

auxiliaryWeights

See "saeObj".

Value

An object of class sadObj if f is of structure ‘x ~ NULL | g’, an object of class saeObj otherwise.

See Also

"saeObj", "sadObj".

Examples

1
2
3
4
5
6
7
8
9
## load data
data("s2", package = "maSAE")
## create sadObj object
sad <- maSAE::saObj(data = s2, f = y ~ NULL | g)
class(sad)
## create saeObj object
s2$s2 <- TRUE
sae <- maSAE::saObj(data = s2, f = y ~ x1 + x2 + x3 | g, s2 = "s2")
class(sae)

maSAE documentation built on April 12, 2021, 5:06 p.m.