CalSSBobj: Create or modify a CalSSB object

View source: R/calSSB.R

CalSSBobjR Documentation

Create or modify a CalSSB object

Description

The elements of the CalSSB object are taken directly from the input parameters.

Usage

CalSSBobj(
  x = NULL,
  y = NULL,
  w = NULL,
  wGross = NULL,
  resids = NULL,
  resids2 = NULL,
  leverages = NULL,
  leverages2 = NULL,
  samplingWeights = NULL,
  extra = NULL,
  id = NULL,
  wave = NULL
)

Arguments

x

NULL or an existing calSSB object

y

y

w

w

wGross

wGross

resids

resids

resids2

resids2

leverages

leverages

leverages2

leverages2

samplingWeights

samplingWeights

extra

extra

id

id

wave

wave

Value

A CalSSB object. That is, an object of the type retuned by CalibrateSSB.

Note

If x is a ReGenesees/cal.analytic object, this function is a wrapper to CalSSBobjReGenesees.

See Also

CalibrateSSB, CalSSBobjReGenesees, WideFromCalibrate, PanelEstimation.

Examples

#' # Generates data - two years
z <- AkuData(3000)  # 3000 in each quarter
zPop <- AkuData(10000)[, 1:7]

# Create a CalSSB object by CalibrateSSB
b <- CalibrateSSB(z, calmodel = "~ sex*age", partition = c("year", "q"), popData = zPop, 
                  y = c("unemployed", "workforce"))

# Modify the CalSSB object
a <- CalSSBobj(b, w = 10*b$w, wave = CrossStrata(z[, c("year", "q")]), id = z$id)

# Use the CalSSB object as input ...
PanelEstimation(WideFromCalibrate(a), "unemployed", linComb = PeriodDiff(8, 4))

# Create CalSSB object without x as input
CalSSBobj(y = b$y, w = 10*b$w, resids = b$resids, wave = CrossStrata(z[, c("year", "q")]), 
          id = z$id)


statisticsnorway/CalibrateSSB documentation built on July 5, 2023, 1:15 p.m.