To install giftedCalcs, run the following code in the R console.
install.packages("devtools")
devtools::install_github("mcbeem/giftedCalcs")
library(giftedCalcs)
4/9/2019
To install giftedCalcs, run the following code in the R console.
install.packages("devtools")
devtools::install_github("mcbeem/giftedCalcs")
library(giftedCalcs)
?giftedCalcs
Click on index at the bottom of the page to see all the functions in the package.
?marginal_psychometrics
?functionnamemarginal_psychometrics()The marginal_psychometrics() function calculates:
These equations come from McBee, Peters, & Miller (2016)
conditional_moments()The user specifies one of:
The first and second moments (e.g., expected value and variance) of the joint multivariate normal distribution of the other two variables is calculated.
conditional_moments(t.true=1.5, relyt=.9, valid=.6)
## $conditional.mean ## [,1] ## n.obs 0.9486833 ## t.obs 1.4230249 ## ## $conditional.cov ## n.obs t.obs ## n.obs 0.6 0.0 ## t.obs 0.0 0.1
conditional_p_id()Calculates the probability of identification for a student with a particular true score.
conditional_p_id(x=2, relyt=.9, test.cutoff=.9, nom.cutoff=.9, valid=.5)
## [1] 0.3843284
The conditional_p_id() function can be used to calculate a conditional identification curve.
# create vector of true scores Tscores <- seq(0,3, length.out=100) # calculate the identification probability for each p.id <- conditional_p_id(x=Tscores, relyt=.9, test.cutoff=.9, nom.cutoff=.9, valid=.5) # make a plot plot(x=Tscores, y=p.id, type="l", xlab="true score", ylab="p identified", ylim=c(0,1)) # add a reference line for the test cutoff abline(v=qnorm(.9), col="red")
The following functions allow you to work with the statistical distribution of scores for identified students.
d_identified(): densityp_identified(): cumulative densityq_identified(): quantile functionr_identified(): random samplesd_identifiedThe density function can be plotted to visualize the probability density of true scores for identified students.
# create vector of true scores
Tscores <- seq(0,4, length.out=200)
# add the un-normed density for the bad system
pdf <- d_identified(x=Tscores, relyt=.9,
test.cutoff=.9, nom.cutoff=.9, valid=.5)
plot(x=Tscores, y=pdf, type="l", col="blue",
main="Distribution of true scores")
abline(v=qnorm(.9), col="red")
It can also be used to visualize the distribution of observed scores. Many of the functions work this way. This is triggered by not providing a value for the relyt= argument.
# create vector of true scores
Tscores <- seq(0,4, length.out=500)
# add the un-normed density for the bad system
pdf <- sapply(Tscores, d_identified, test.cutoff=.9,
nom.cutoff=.9, valid=.5, normalize=FALSE)
plot(x=Tscores, y=pdf, type="l", col="blue",
main="Distribution of observed scores")
abline(v=qnorm(.9), col="red")
p_identified()This is the cumulative density function for identified students.
Given a true (or observed) score, it returns the percentile.
p_identified(x=1.5, relyt=.95, test.cutoff=.9,
nom.cutoff=.9, valid=.5)
## [1] 0.2617256
q_identified()This is the quantile function for identified students.
Given a percentile, it returns the associated true (or observed) score for identified students.
q_identified(percentile=.8, relyt=.95, test.cutoff=.9,
nom.cutoff=.9, valid=.5)
## [1] 2.243256
r_identified()This samples random values from the distribution of true or observed scores of identified students.
This is useful for simulation purposes.
r_identified(n=10, relyt=.95, test.cutoff=.9,
nom.cutoff=.9, valid=.5)
## [1] 1.672412 2.395773 1.550169 1.933561 1.952277 1.214970 2.106214 ## [8] 1.525831 1.437669 1.833512
mean_identified(): mean or expected value for identified studentssd_identified(): standard deviation for identified studentsmean_identified(relyt=.95, test.cutoff=.9,
nom.cutoff=.9, valid=.5)
## [1] 1.850697
sd_identified(relyt=.95, test.cutoff=.9,
nom.cutoff=.9, valid=.5)
## [1] 0.5055684
estimate_valid()Infer identification system nomination validity and performance from observed data
estimate_performance(x=data, id.rate=.032, nom.rate=0.1, reps=500)
## $summary ## Estimate StdErr CI.95.lower CI.95.upper ## valid 0.50836 0.01345 0.48199 0.53473 ## sensitivity 0.33044 0.00842 0.31393 0.34695 ## nom.passrate 0.32645 0.00832 0.31014 0.34275 ## test.cutoff 0.90121 NA NA NA ## nom.cutoff 0.90000 NA NA NA ## ## $note ## [1] "Since the test reliability was not specified, the sensitivity value is interpreted as relative to universal screening. Achieved sensitivity is dependent on the test reliability."
Optimal identification is a method for designing an identification process for maximal psychometric performance.
Functions:
reliability_mean()var_mean()cor_mean()shrinkage_mean()