Load the data.
dataset = read.table('oxygen.txt')
Install the package.
install.packages("profileR", repos="http://cran.us.r-project.org")
## Installing package into 'C:/Users/sm/Documents/R/win-library/3.6'
## (as 'lib' is unspecified)
## package 'profileR' successfully unpacked and MD5 sums checked
##
## The downloaded binary packages are in
## C:\Users\sm\AppData\Local\Temp\RtmpK4nSUa\downloaded_packages
library(profileR)
## Loading required package: ggplot2
## Loading required package: RColorBrewer
## Loading required package: reshape
## Loading required package: lavaan
## This is lavaan 0.6-5
## lavaan is BETA software! Please report any bugs.
Run the profile analysis function and plot the Profile. 1 is male, 0 is female.
pa <- pbg(dataset[1:4], group = c(rep(1,25), rep(0, 25)), profile.plot = TRUE)
Display the sample means.
print(pa)
##
## Data Summary:
## 0 1
## v1 0.3136 0.3972
## v2 5.1788 5.3296
## v3 2.3152 3.6876
## v4 38.1548 49.4204
Display the test outputs.
summary(pa)
## Call:
## pbg(data = dataset[1:4], group = c(rep(1, 25), rep(0, 25)), profile.plot = TRUE)
##
## Hypothesis Tests:
## $`Ho: Profiles are parallel`
## Multivariate.Test Statistic Approx.F num.df den.df p.value
## 1 Wilks 0.3728944 25.78644 3 46 6.17633e-10
## 2 Pillai 0.6271056 25.78644 3 46 6.17633e-10
## 3 Hotelling-Lawley 1.6817242 25.78644 3 46 6.17633e-10
## 4 Roy 1.6817242 25.78644 3 46 6.17633e-10
##
## $`Ho: Profiles have equal levels`
## Df Sum Sq Mean Sq F value Pr(>F)
## group 1 129.4 129.4 40.47 7.01e-08 ***
## Residuals 48 153.6 3.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## $`Ho: Profiles are flat`
## F df1 df2 p-value
## 1 875.8325 3 46 1.436427e-40
So data fails all three tests. Profiles are not parallel, Profiles do not have equal levels and Profiles are not flat.