In: Statistics and Probability
Want to preform profile analysis on groups that are not independent. Suppose that the data, spouse, from profileR in R, were a sample of couples, with husbands and wives each rating their own spouses. Formulate and test the same first two hypotheses (parallel and coincident) as were discussed in class. Suggest a way to formulate and test the third hypothesis(level).
Will rate positively, thanks
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.
here flat mean concident.
Formate of code :
pbg(data, group, original.names = FALSE, profile.plot = FALSE)
Object of class profg is returned, listing the following components:
data.summary - Means of observed variables by the grouping variable
corr.table - A matrix of correlations among observed variables splitted by the grouping variable
profile.test - Results of F-tests for testing parallel, coincidential, and level profiles across two groups.
### R - Code
Load package :
library(ggplot2)
library (RcolorBrewer)
library (reshape)
library (lavaan)
#Note : if above package is not available in your r package
directory. then please install them using following command
install.package("package name", dependencies = TRUE) .then
load.
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
####
run above code in r you will get output as below.
# 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