dynamr: A Permutation-Based Changepoint Technique for Monitoring...

Description Usage Arguments Examples

View source: R/dynamr.R

Description

dynamr is used to detect where effect values change temporally when estimating generalized linear models with panel data.

Usage

1
2
dynamr(dat, time_var, formula, N = 2000, window_size,
  family = c("gaussian", "binomial", "poisson"))

Arguments

dat

Data frame with panel data of interest

time_var

Name of variable denoting time period for any observation, must be a character

formula

Formula for glm object

N

Number of coefficient samples extracted for calculating stable statistical behavior, defaults to 2000

window_size

Number of time periods per model

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
library(ISLR)
library(dynamr)

data("Weekly")

stock_dynam <- dynamr(
 dat = Weekly,
 time_var = "Year",
 formula = Today ~ Lag1 + Lag2,
 window_size = 1,
 family = "gaussian",
 N = 5000
)

stock_dynam

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