apdesign_i: apdesign_i: AP coding for a single subject

Description Usage Arguments Value Examples

Description

apdesign_i: AP coding for a single subject

Usage

1
2
apdesign_i(data, cycle_var, center_cycle, time_var, center_time,
  max_degree = c(1, 1), matricies = FALSE)

Arguments

data

A data frame.

cycle_var

A character that indicates the cycle indicator in data.

center_cycle

A numeric specifying the cycle to center on.

time_var

A character that indicates the within-cycle time indicator in data.

center_time

A numeric specifying the within-cycle time to center on.

max_degree

A vector of numerics specifying the highest degree for each polynomial.

matricies

If TRUE, will print the AP, D1 and D2 matricies.

Value

Output will be a matrix.

Examples

1
2
3
4
5
6
y <- c(10, 15, 21, 20, 23, 25, 27, 25, 28, 29)
time <- c(c(0.2, 0.5, 0.7), c(0.3, 0.6, 0.75, 0.89), c(0.1, 0.3, 0.8))
cycle <- c(rep(1, 3), rep(2, 4), rep(3, 3))
df <- data.frame(y, time, cycle)
apdesign_i(data = df, time_var = "time", cycle_var = "cycle", 
         center_cycle = 1, center_time = 0, max_degree = c(2,1))

tmatta/apdesign documentation built on May 31, 2019, 4:35 p.m.