pois_vcm_cv: pois_vcm_cv: Cross-Validation for Poisson Time-Varying...

Description Usage Arguments Value Author(s) Examples

View source: R/pois_vcm_cv.R

Description

This function conducts a leave-one-out cross-validation approach to determine the best bandwidth for the data.

Usage

1
2
3
4
5
6
7
8
pois_vcm_cv(
  formula,
  data,
  time,
  id = NULL,
  bandwidths = NULL,
  kernel = "epanechnikov"
)

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.

bandwidths

A vector containing the bandwidth values for the cross-validation. Default is tests 50 bandwidths from ranging from double the smallest time point difference to range of time points.

kernel

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

Value

pois_vcm_cv returns a list containing the results from the cross-validation

Author(s)

Isaac Quintanilla Salinas

Examples

1
2
3
cv_fit <- pois_vcm_cv(formula = Y~x1+x2, data = pois_data, time = time, id = id)

summary(cv_fit)

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