pooled_glm_test: Test a generalized linear model for the presence of...

Description Usage Arguments Examples

View source: R/pooled_glm_test.R

Description

pooled_glm_test is used to test the temporal effect homogeneity of a generalized linear model with panel data.

Usage

1
2
pooled_glm_test(formula, Panel.data, N = 100, family = c("gaussian",
  "binomial", "poisson"))

Arguments

formula

An object of class "formula", which provides a symbolic description of the model to be fitted. Ensure that names included here are contained with the data frame entries of the Panel.data object.

Panel.data

A list of data frames containing the predictors and response variables listed in the model formula. List entries are assumed to be ordered according to time.

N

The number of bootstrap samples to run for this test. Default is 100.

family

A description of the error distribution to be used for the fitted glm. Currently, there are three options: "gaussian" - multivariate linear regression; "binomial" - multivariate logistic regression; "poisson" - multivariate Poisson regression

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(ISLR)

data("Weekly")

stock_list <- list()

for(i in 1:21){
 time <- 1989 + i
 stock_list[[i]] <- dplyr::filter(Weekly, Year == time)
}

stock.p.value <- pooled_glm_test(
 formula = Today ~ Lag1 + Lag2,
 Panel.data = stock_list,
 N = 300,
 family = "gaussian"
)

stock.p.value$p.value

dnkent/dynamr documentation built on June 29, 2021, 7:22 p.m.