pbg: Profile Analysis by Group: Testing Parallelism, Equal Levels,...

Description Usage Arguments Value See Also Examples

View source: R/pbg.R

Description

The pbg function implements three hypothesis tests. These tests are whether the profiles are parallel, have equal levels, and are flat across groups defined by the grouping variable. If parallelism is rejected, the other two tests are not necessary. In that case, flatness may be assessed within each group, and various within- and between-group contrasts may be analyzed.

Usage

1
pbg(data, group, original.names = FALSE, profile.plot = FALSE)

Arguments

data

A matrix or data frame with multiple scores; rows represent individuals, columns represent subscores. Missing subscores have to be inserted as NA.

group

A vector or data frame that indicates a grouping variable. It can be either numeric or character (e.g., male-female, A-B-C, 0-1-2). The grouping variable must have the same length of x. Missing values are not allowed in y.

original.names

Use original column names in x. If FALSE, variables are renamed using v1, v2, ..., vn for subscores and "group" for the grouping variable. Default is FALSE.

profile.plot

Print a profile plot of scores for the groups. Default is FALSE.

Value

An object of class profg is returned, listing the following components:

See Also

pr, profileplot

Examples

1
2
3
4
5
6
7
## Not run: 
data(spouse)
mod <- pbg(data=spouse[,1:4], group=spouse[,5], original.names=TRUE, profile.plot=TRUE)
print(mod) #prints average scores in the profile across two groups
summary(mod) #prints the results of three profile by group hypothesis tests

## End(Not run)

Example output

Loading required package: ggplot2
Loading required package: RColorBrewer
Loading required package: reshape
Loading required package: lavaan
This is lavaan 0.5-23.1097
lavaan is BETA software! Please report any bugs.

Data Summary:
       Husband     Wife
item1 3.900000 3.833333
item2 3.966667 4.100000
item3 4.333333 4.633333
item4 4.400000 4.533333
Call:
pbg(data = spouse[, 1:4], group = spouse[, 5], original.names = TRUE, 
    profile.plot = TRUE)

Hypothesis Tests:
$`Ho: Profiles are parallel`
  Multivariate.Test Statistic Approx.F num.df den.df    p.value
1             Wilks 0.8785726 2.579917      3     56 0.06255945
2            Pillai 0.1214274 2.579917      3     56 0.06255945
3  Hotelling-Lawley 0.1382099 2.579917      3     56 0.06255945
4               Roy 0.1382099 2.579917      3     56 0.06255945

$`Ho: Profiles have equal levels`
            Df Sum Sq Mean Sq F value Pr(>F)
group        1  0.234  0.2344   1.533  0.221
Residuals   58  8.869  0.1529               

$`Ho: Profiles are flat`
         F df1 df2      p-value
1 24.82071   3  57 0.0001554491

profileR documentation built on April 20, 2018, 1:04 a.m.