make_fixed_weights: Create weights based on a fixed time period

Description Usage Arguments Value

View source: R/make_fixed_weights.R

Description

make_fixed_weights creates a weight for panel units based on a specific time period in the sample.

Usage

1
make_fixed_weights(panel_data, weight_time, weight_var, panel_unit_vars)

Arguments

panel_data

The data for which weights are to be calculated (data.table)

weight_time

The time period(s) that correspond to the time period of the weights, as a list. For example, if the time period were year == 2008 & month == 1, it would be correct to have weight_time = list(year = 2008, month = 1) (list)

weight_var

The name of the variable in panel_data that will be used to create the weight (character)

panel_unit_vars

The name(s) of the variables in panel_data that uniquely identify the panel units for which the weights are to be calculated (character)

Value

The same panel_data dataset but with a new variable ending in ".weight" on the panel_unit_vars level


johnnybonney/sales.taxes documentation built on Dec. 18, 2018, 2:37 a.m.