tvcm: tvcm: Time-Varying Coefficient Models

Description Usage Arguments Value Author(s) Examples

View source: R/tvcm.R

Description

This function estimates the time-varying coefficient model at different time points.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
tvcm(
  formula,
  data,
  time,
  id = NULL,
  ngrids = 200,
  grid_points = NULL,
  bandwidth = NULL,
  kernel = "epanechnikov",
  se = FALSE,
  alpha = 0.05,
  nboot = 1000
)

Arguments

formula

A formula class object. Provides information about the names of the response and predictor variables.

data

A data frame containing the variables needed for the function.

time

The name of the variable indicating the time points for each observation.

id

The name of the variable to group observations. Necessary when dealing with repeated measurements such as longitudinal data.

ngrids

When specified, a vector of size ngrid is created for the varying-coefficient values. The default value is 200. The vector is creates using the maximum and minimum from the provided time points.

grid_points

A vector indicating the grid points to estimate the varying coefficient values. When specified, ngrid is ignored.

bandwidth

A numeric value indicating the bandwidth. Default is the tenth of the range of the time points.

kernel

The name of the kernel function used to estimate the varying-coefficient values. Default is Epanechnikov.

se

If set TRUE, a bootstrap method is applied to estimate the standard errors and percentiles.

alpha

A value indicating the significance level for the percentiles.

nboot

A number indicating how many boot samples to construct.

Value

tvcm returns a list containing the estimated varying coefficients

Author(s)

Isaac Quintanilla Salinas

Examples

1
2
tvcm(formula = Y~x1+x2, data = normal_data, time = time, 
     id = id, se = TRUE, nboot = 100)

inqs909/tvcm documentation built on Dec. 20, 2021, 7:03 p.m.