scaleDiagnosis provides a number of diagnostics for a scale (an aggregative measure consisting of several items).
scaleDiagnosis(
data = NULL,
items = NULL,
plotSize = 180,
sizeMultiplier = 1,
axisLabels = "none",
scaleReliability.ci = FALSE,
conf.level = 0.95,
normalHist = TRUE,
poly = TRUE,
digits = 3,
headingLevel = 3,
scaleName = NULL,
...
)
# S3 method for scaleDiagnosis
print(x, digits = x$digits, ...)
scaleDiagnosis_partial(
x,
headingLevel = x$input$headingLevel,
quiet = TRUE,
echoPartial = FALSE,
partialFile = NULL,
...
)
# S3 method for scaleDiagnosis
knit_print(
x,
headingLevel = x$headingLevel,
quiet = TRUE,
echoPartial = FALSE,
partialFile = NULL,
...
)
A dataframe containing the items in the scale. All variables in this dataframe will be used if items is NULL.
If not NULL, this should be a character vector with the names of the variables in the dataframe that represent items in the scale.
Size of the final plot in millimeters.
Allows more flexible control over the size of the plot elements
Passed to ggpairs function to set axisLabels.
TRUE or FALSE: whether to compute confidence intervals for Cronbach's Alpha and Omega (uses bootstrapping function in MBESS, takes a while).
Confidence of confidence intervals for reliability estimates (if requested with scaleReliability.ci).
Whether to use the default ggpairs histogram on the
diagonal of the scattermatrix, or whether to use the normalHist()
version.
Whether to also request the estimates based on the polychoric
correlation matrix when calling scaleStructure()
.
The number of digits to pass to the print
method for the
descriptives dataframe.
The level of the heading (number of hash characters to insert before the heading, to be rendered as headings of that level in Markdown).
Optionally, a name for the scale to print as heading for the results.
Additional arguments for scaleDiagnosis()
are passed on to
scatterMatrix()
, and additional arguments for the print
method are passed
to the default print
method.
The object to print.
Whether to be chatty (FALSE
) or quiet (TRUE
).
Whether to show the code in the partial (TRUE
) or hide it (FALSE
).
The file with the Rmd partial (if you want to overwrite the default).
An object with the input and several output variables. Most notably:
The results of scaleReliability.
A Principal Components Analysis
A Factor Analysis
Decriptive statistics about the items
A scattermatrix with histograms on the diagonal and correlation coefficients in the upper right half.
Function to generate an object with several useful statistics and a plot to assess how the elements (usually items) in a scale relate to each other, such as Cronbach's Alpha, omega, the Greatest Lower Bound, a factor analysis, and a correlation matrix.
### Note: the 'not run' is simply because running takes a lot of time,
### but these examples are all safe to run!
if (FALSE) {
### This will prompt the user to select an SPSS file
scaleDiagnosis();
### Generate a datafile to use
exampleData <- data.frame(item1=rnorm(100));
exampleData$item2 <- exampleData$item1+rnorm(100);
exampleData$item3 <- exampleData$item1+rnorm(100);
exampleData$item4 <- exampleData$item2+rnorm(100);
exampleData$item5 <- exampleData$item2+rnorm(100);
### Use a selection of two variables
scaleDiagnosis(data=exampleData, items=c('item2', 'item4'));
### Use all items
scaleDiagnosis(data=exampleData);
}