Learn R Programming

FunSurv (version 1.0.0)

ar1_cor: Construct an AR(1) correlation matrix

Description

Construct an AR(1) correlation matrix

Usage

ar1_cor(n, rho)

Value

A n by n matrix

Arguments

n

number of events for each subject

rho

autoregressive correlation

Examples

Run this code
## Generate AR(1) structure
ar1_cor(n = 5, rho = 0.3)

## first derivative of the AR(1) structure with respect to rho
dar1_cor.drho(n = 5, rho = 0.3)

Run the code above in your browser using DataLab