This function conducts a generalized piecewise regression analysis and shows a plot illustrating the results.

genPwr(data, yVar, phaseVar, timeVar, digits = 3)

# S3 method for genPwr
print(x, digits = x$input$digits, ...)

# S3 method for genPwr
plot(x, ...)

Arguments

data

The dataframe containing the variables for the analysis.

yVar

The name of the dependent variable.

phaseVar

The variable containing the phase of each measurement. Note that this normally should have three (withdrawal ABA design) or four (reversal ABAB design) values.

timeVar

The name of the variable containing the measurement moments (or an index of measurement moments).

digits

The number of digits to show in the results.

x

genPwr fittted object

...

other parameters not used

Value

Mainly, this function prints its results, but it also returns them in an object containing three lists:

input

The arguments specified when calling the function

intermediate

Intermediate objects and values

output

The results such as the parameter estimates and the plot.

Author

Peter Verboon (the Open University of the Netherlands)

Maintainer: Peter Verboon

Examples

time <- c(0:29) score <- c(4,2,3,4,3,4,3,5,6,7,6,7,8,8,7,5,6,4,5,5,6,5,5,4,4,5,6,7,6,7) fase4 <- as.factor(c(rep("a",7), rep("b",8), rep("c",7), rep("d",8))) dat <- data.frame(time = time, score = score, fase4 = fase4) result <- genPwr(data = dat, yVar = "score", phaseVar = "fase4", timeVar = "time") plot(result)
print(result)
#> Generalized Piecewise Regression (N = 30) #> #> Model statistics: #> #> Model deviance: 12.167 #> R squared for null model: .169 #> R squared for test model: .986 #> R squared based effect size: .984 #> Standardized effect size: 3.915 #> #> Regression coefficients #> ----------------------------------------------- #> effect estimate low_lim CI upp_lim CI #> ---------- ---------- ------------ ------------ #> level A1 3.393 2.342 4.444 #> #> level B1 7.917 6.921 8.912 #> #> level A2 5.25 4.199 6.301 #> #> level B2 6.917 5.921 7.912 #> #> trend A1 0.036 -0.256 0.327 #> #> trend B1 0.333 0.095 0.571 #> #> trend A2 0.036 -0.256 0.327 #> #> trend B2 0.405 0.167 0.643 #> ----------------------------------------------- #>