Learn R Programming

SSDforR (version 1.0)

Arimama: Moving average uses Package TTR

Description

Moving average over any period

Usage

Arimama(behavior, phaseX, v, m)

Arguments

behavior
behavior variable
phaseX
phase variable
v
phase letter i.e. "A"
m
number of periods to average over i.e. 2

References

Go to www.ssdanalysis.com for more information

Examples

Run this code
cry<-c(3, 4, 2, 5, 3, 4, NA, 2, 2, 3, 2, 1, 2, NA, 2, 2, 1, 2, 1, 0, 0, 0)
pcry<-c("A", "A", "A", "A", "A", "A", NA, "B", "B", "B", "B", "B", "B", NA, "B1", "B1", "B1", "B1", "B1", "B1", "B1", "B1")
Arimama(cry,pcry,"B1",2)

Run the code above in your browser using DataLab