Index | R Documentation |
key_list (scoring keys): Extract names and signs from a psych::principal object.
Index(x, ...)
## S3 method for class 'formula'
Index(x, data, ...)
## S3 method for class 'data.frame'
Index(
x,
...,
re.code = FALSE,
fun = "mean",
na.rm = TRUE,
digits = 4,
max.level = NA,
min.level = NA
)
## Default S3 method:
Index(
...,
re.code = FALSE,
fun = "mean",
na.rm = TRUE,
digits = 4,
max.level = NA,
min.level = NA
)
Sum2(
...,
re.code = FALSE,
fun = "mean",
na.rm = TRUE,
digits = 4,
max.level = NA,
min.level = NA
)
key_list(x, loadings = 0.4, communality = 0.4)
## S3 method for class 'principal'
Index(x, data = NULL, loadings = 0.4, communality = 0.4, ...)
x , data |
data.frame x ist entwerde formula oder ein data.frame #'oder psych::principal-Objekt |
... |
an scoreItems min=1, max=6, missing = TRUE (is the normal case and data are imputed) |
re.code |
revers code logical |
fun |
mean or sum |
na.rm |
NA remove |
digits |
Nachkomastellen |
max.level , min.level |
nin und max levels |
loadings |
threshold for loadings |
communality |
threshold communality |
Vektor
matrix
matrix
# Methode um den Index ueber stp25stat2::Tbll_reliability
# zu erhalten und gleichzeitig die Statistik zu behalten
Skalen <- function(...) {
var_name <-
gsub("[^[:alnum:\\._] ]", "",
var_name <- gsub("[^[:alnum:\\._] ]", "",
strsplit(capture.output(sys.call()) , "[ <]")[[1]][1]))
measure.vars <-
sapply(lazyeval::lazy_dots(...), function(x) {
as.character(x[1])
})
rslt <- Tbll_reliability(DF[measure.vars])
if(nchar(var_name) > 0){
cat("\nvar_name:",var_name, "\n")
DF[[var_name]] <<- rslt$index
attr(DF[[var_name]], "label") <<-
gsub("\\.", " ", var_name)
}
rslt
}
DF <- data.frame( az1= 1:5, az2=1:5, az3=1:5 )
# Arbetszufriedenheit <- Skalen(az1, az2, az3)
require(psych)
data(bfi)
rslt <- psych::principal(bfi[1:25], 5)
# keys <-
# list(agree= c("-A1","A2","A3","A4","A5"),
# conscientious= c("C1","C2","C3","-C4","-C5"),
# extraversion= c("-E1","-E2","E3","E4","E5"),
# neuroticism= c("N1","N2","N3","N4","N5"),
# openness = c("O1","-O2","O3","O4","-O5"))
key_list(rslt)
scores <-
psych::scoreItems(key_list(rslt), bfi , min=1, max=6)
#specify the minimum and maximum values
scores$alpha
summary(scores)
head(scores$scores)
head(Index(rslt, bfi))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.