The output from all the examples
in profileR
is included in this vignette. This vignette can
be built to verify there are no problems with the code and can be used
to compare your results against the results published on the wiki.
If there are any discrepancies, please open an issue on GitHub.
library(profileR)
#> Loading required package: ggplot2
#> Loading required package: RColorBrewer
#> Loading required package: reshape
#> Loading required package: lavaan
#> This is lavaan 0.6-19
#> lavaan is FREE software! Please report any bugs.
example(mpa, run.dontrun = TRUE)
#>
#> mpa> data(mod_data)
#>
#> mpa> mod <- mpa(gpa ~ satv * major + satq * major, moderator = "major", data = bacc2001)
#> # -------- Executing Stage 1 -------- #
#> # -------- Executing Stage 2 -------- #
#>
#> mpa> summary(mod$output)
#>
#> Call:
#> lm(formula = resp ~ 1 + level.ref + level.focal + pat.ref + pat.diff +
#> z, data = model.data)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -143.511 -25.249 1.599 26.844 132.269
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 203.95852 10.18220 20.031 < 2e-16 ***
#> level.ref 0.21458 0.01786 12.014 < 2e-16 ***
#> level.focal -0.02860 0.02969 -0.963 0.336
#> pat.ref 2.00000 1.21898 1.641 0.101
#> pat.diff 2.00000 0.50062 3.995 6.91e-05 ***
#> z -3.56317 18.10308 -0.197 0.844
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 40.78 on 1074 degrees of freedom
#> Multiple R-squared: 0.1867, Adjusted R-squared: 0.1829
#> F-statistic: 49.3 on 5 and 1074 DF, p-value: < 2.2e-16
#>
#>
#> mpa> mod$f.table
#> F.stat df1 df2 p-value
#> 1.596045e+01 1.000000e+00 1.074000e+03 6.908838e-05
#>
#> mpa> summary(mod$moder.model)
#>
#> Call:
#> lm(formula = formula, data = data, na.action = na.action)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -143.511 -25.249 1.599 26.844 132.269
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 203.95852 10.18220 20.031 < 2e-16 ***
#> satv 0.13776 0.01851 7.444 2.0e-13 ***
#> majorstem -3.56317 18.10308 -0.197 0.844000
#> satq 0.07683 0.02251 3.414 0.000665 ***
#> satv:majorstem -0.12770 0.02849 -4.482 8.2e-06 ***
#> majorstem:satq 0.09910 0.03522 2.814 0.004984 **
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 40.78 on 1074 degrees of freedom
#> Multiple R-squared: 0.1867, Adjusted R-squared: 0.1829
#> F-statistic: 49.3 on 5 and 1074 DF, p-value: < 2.2e-16
example(pams, run.dontrun = TRUE)
#>
#> pams> data(PS)
#>
#> pams> result <- pams(PS[,2:4], dim=2)
#>
#> pams> result
#> $weights.matrix
#> weight1 weight2 level R.sq
#> [1,] 1.5 0.00000 70 1
#> [2,] 1.5 0.00000 40 1
#> [3,] 0.0 2.12132 70 1
#> [4,] 0.0 2.12132 40 1
#> [5,] -1.5 0.00000 70 1
#> [6,] -1.5 0.00000 40 1
#>
#> $dimensional.configuration
#> Dimension1 Dimension2
#> Neu -6.666667 -2.357023
#> Psy 0.000000 4.714045
#> CD 6.666667 -2.357023
example(paos, run.dontrun = TRUE)
#>
#> paos> data(nutrient)
#>
#> paos> paos(nutrient, scale=TRUE)
#> T-Squared F df1 df2
#> Ho: Ratios of the means over Mu0=1 1392.347 276.9559 5 732
#> Ho: All of the ratios are equal to each other 1278.073 318.2159 4 733
#> p-value
#> Ho: Ratios of the means over Mu0=1 0
#> Ho: All of the ratios are equal to each other 0
example(pbg, run.dontrun = TRUE)
#>
#> pbg> data(spouse)
#>
#> pbg> mod <- pbg(data=spouse[,1:4], group=spouse[,5], original.names=TRUE, profile.plot=TRUE)
#>
#> pbg> print(mod) #prints average scores in the profile across two groups
#>
#> Data Summary:
#> Husband Wife
#> item1 3.900000 3.833333
#> item2 3.966667 4.100000
#> item3 4.333333 4.633333
#> item4 4.400000 4.533333
#>
#> pbg> summary(mod) #prints the results of three profile by group hypothesis tests
#> 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 8.18807 3 56 0.0001310162
example(pr, run.dontrun = TRUE)
#>
#> pr> data(EEGS)
#>
#> pr> result <- pr(EEGS[,c(1,3,5)],EEGS[,c(2,4,6)])
#>
#> pr> print(result)
#> Subscore Reliability Estimates:
#>
#> Estimate
#> Level 0.9245548
#> Pattern 0.9338338
#> Overall 0.9308374
#>
#> pr> plot(result)
example(wprifm, run.dontrun = TRUE)
#>
#> wprifm> data <- HolzingerSwineford1939[,7:ncol(HolzingerSwineford1939)]
#>
#> wprifm> wprifm(data, scale = TRUE)
#> lavaan 0.6-19 ended normally after 21 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 20
#> Number of equality constraints 1
#>
#> Number of observations 301
#>
#> Model Test User Model:
#>
#> Test statistic 158.922
#> Degrees of freedom 26
#> P-value (Chi-square) 0.000
leisure
datasetspouse
dataset