Aregres: Regression for single phase

Description Usage Arguments Author(s) References Examples

View source: R/Aregres.R

Description

Conducts OLS regression for any phase. Coefficients and residuals are produced. Also a simple line graph for the specified phase with a regression line is displayed in the graph window.

Usage

1
Aregres(behavior, phaseX, v1)

Arguments

behavior

behavior variable

phaseX

phase variable

v1

phase letter (e.g., "A")

Author(s)

Charles Auerbach, PhD & Wendy Zeitlin, PhD; Yeshiva University, Wurzweiler School of Social Work

References

Auerbach, Charles, and Zeitlin Wendy. SSD for R: An R Package for Analyzing Single-Subject Data. Oxford University Press, 2014. p34, p35-36, p134

Go to www.ssdanalysis.com for more information.

Examples

1
2
3
4
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")
Aregres(cry,pcry,"A")

Example output

Loading required package: psych
Loading required package: TTR
Loading required package: MASS
Loading required package: tcltk
Loading required package: TSA

Attaching package: 'TSA'

The following objects are masked from 'package:stats':

    acf, arima

The following object is masked from 'package:utils':

    tar

Warning message:
no DISPLAY variable so Tk is not available 

Call:
lm(formula = A ~ x1)

Residuals:
      1       2       3       4       5       6 
-0.1429  0.7143 -1.4286  1.4286 -0.7143  0.1429 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept)   3.0000     1.0556   2.842   0.0468 *
x1            0.1429     0.2711   0.527   0.6260  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.134 on 4 degrees of freedom
Multiple R-squared:  0.06494,	Adjusted R-squared:  -0.1688 
F-statistic: 0.2778 on 1 and 4 DF,  p-value: 0.626

SSDforR documentation built on Oct. 7, 2018, 1:03 a.m.