CalibrateSSBpanel2: Calibration weighting and variance estimation for panel data

Description Usage Arguments Value Examples

View source: R/CalibrateSSB.R

Description

The function is similar to CalibrateSSBpanel but rewritten since the advanced original code is problematic to re-export. Output is combined into a data frame. The function combines CalibrateSSB, WideFromCalibrate and PanelEstimation into a single function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
CalibrateSSBpanel2(
  data,
  ...,
  numerator,
  denominator = NULL,
  linComb = NULL,
  linComb0 = NULL,
  estType = "robustModel",
  leveragePower = 1/2,
  group = NULL,
  returnCov = FALSE,
  usewGross = TRUE
)

Arguments

data

The gross sample data frame

...

Further arguments to CalibrateSSB including variables needed by WideFromCalibrate

numerator

Argument to PanelEstimation

denominator

Argument to PanelEstimation

linComb

Argument to PanelEstimation

linComb0

Argument to PanelEstimation

estType

Argument to PanelEstimation

leveragePower

Argument to PanelEstimation

group

Argument to PanelEstimation

returnCov

Argument to PanelEstimation

usewGross

Argument to PanelEstimation

Value

Output from PanelEstimation combined into a data frame

Examples

1
2
3
4
5
6
7
8
z    <- AkuData(3000)  # 3000 in each quarter
zPop <- AkuData(10000)[,1:7]
lc <- rbind(CalibrateSSB::LagDiff(8,4),CalibrateSSB::PeriodDiff(8,4))
rownames(lc) <- c("diffQ1","diffQ2","diffQ3","diffQ4","diffYearMean")
CalibrateSSBpanel2(z, calmodel="~ sex*age", partition=c("year","q"), popData=zPop, 
       y=c("unemployed","workforce"), id="id", wave=c("year","q"),
       numerator="unemployed", linComb=lc)
       

statisticsnorway/metodebibliotek_testing documentation built on Jan. 21, 2022, 9:24 p.m.