Takes an ItemAnalysis object, and returns the column names, i.e. the item labels of those items that load the highest on the single factor. Defaults to 5 items.
Usage
ChooseBest(it, n=5)
Arguments
it
An ItemAnalysis object, produced by the ItemAnalysis() function.
n
The number of items to select. Asking for more items than available leads to an error.
Value
A character vector, with the labels of the items, as defined in ScaleData object.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Scale)
Loading required package: psych
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2
Attaching package: 'ggplot2'
The following objects are masked from 'package:psych':
%+%, alpha
Attaching package: 'Hmisc'
The following object is masked from 'package:psych':
describe
The following objects are masked from 'package:base':
format.pval, round.POSIXt, trunc.POSIXt, units
Loading required package: MASS
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Scale/ChooseBest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ChooseBest
> ### Title: Select Items from Item Analysis.
> ### Aliases: ChooseBest
> ### Keywords: survey multivariate
>
> ### ** Examples
>
> data(Depression98)
> depressionScale <- Scale(data=Depression98,
+ orders=list(
+ c(16,19,11,9,1,17,5,18,4,8,2,12,
+ 20,10,14,6,3,13,15,7),
+ c(1,18,4,15,7,8,3,14,20,6,19,16,
+ 12,5,10,13,2,17,11,9)),
+ orders_id=c(
+ rep(1, 49),
+ rep(2, 49)),
+ reverse=c(3,4,13,14,18,20),
+ col_names= paste('q', 1:20, sep=''))
> depressionPre <- PreProc(depressionScale)
Warning message:
In PreProc(depressionScale) :
Items' vector unspecified. out$items is NULL...
>
> depressionRel <- ItemAnalysis(depressionPre)
>
> depressionItems <- ChooseBest(depressionRel)
>
>
>
>
>
> dev.off()
null device
1
>