Learn R Programming

coefficientalpha (version 0.2.6)

plot.alpha: Alpha related plot

Description

Generate plot related to alpha. Three plot can be generated. (1) The weight plot will plot the weight associated with alpha calculation. (2) Profile plot will plot the cases with smallest weights and the average value. (3) The diagnostic plot plots the alpha according to different values of the tuning parameter.

Usage

## S3 method for class 'alpha':
plot(x, type="weight", profile=5, interval=0.01,center=TRUE, scale=FALSE, w1=FALSE, numbered=FALSE, pos="topright",...)

Arguments

x
Results from the function cronbach.
type
Three types of plots can be generated. type="weight" generates the plot of weight of each case. type="profile" generates a profile plot for the smallest weight. type="weight" generates the diagnostic plot for
profile
Number of cases used on the profile plot. At most 10.
interval
The interval used in the diagnostic plot. The default is 0.01.
center
Whether to center the data in the profile plot.
scale
Whether to scale the data using variance parameters in the profile plot.
w1
Whether to plot the weight for means
numbered
Whether to number the profile plot
pos
Position of legend. If pos=NULL, no legend is plotted.
...
Options can be passed to the plot function.

References

Zhang, Z. & Yuan, K.-H. (2013). Robust Cronbach's alpha.

Examples

Run this code
data(holzinger)
spatial<-holzinger[, c('visual', 'cubes', 'paper', 'lozenge', 'paperrev','flagssub')]
verbal<-holzinger[, c('general', 'paragrap', 'sentence', 'wordc', 'wordm')]
speed<-holzinger[, c('add', 'code', 'counting', 'straight')]
memory<-holzinger[, c('wordr', 'numberr', 'figurer', 'object', 'numberf', 'figurew')]

alpha.spatial<-cronbach(spatial)
## diagnostic plot
plot(alpha.spatial, type='d')

## alpha with varphi=.01 & standard error
alpha.spatial<-cronbach(spatial, varphi=.01, se=TRUE)
## confidence interval
summary(alpha.spatial)

## weight plot
plot(alpha.spatial)
# or
plot(alpha.spatial, type='w')

## profile plot
plot(alpha.spatial, type='p')


alpha.verbal<-cronbach(verbal, varphi=.02, se=TRUE)
## confidence interval
summary(alpha.verbal)

## weight plot
plot(alpha.verbal)

## profile plot
plot(alpha.verbal, type='p', profile=6)

alpha.speed<-cronbach(speed, varphi=.01, se=TRUE)
## confidence interval
summary(alpha.speed)

## weight plot
plot(alpha.speed)

## profile plot
plot(alpha.speed, type='p', pos='topleft')

alpha.memory<-cronbach(memory, varphi=.04, se=TRUE)
## confidence interval
summary(alpha.memory)

## weight plot
plot(alpha.memory)

## profile plot
plot(alpha.memory, type='p', profile=10, pos='bottomright')
 plot(alpha.memory, type='p', profile=10, scale=TRUE, pos='bottomright')

Run the code above in your browser using DataLab