Last chance! 50% off unlimited learning
Sale ends in
The function gives the conditional probability of replacement
pfake(k, h = k, p = c(0,0), Q = 5, gam = c(1,1), del = c(1,1),
fake.model = c("uninformative", "average", "slight", "extreme"))
A fake value.
An observed original value.
Overall probability of replacement: p[1]
indicates the faking good probability, p[2]
indicates the faking bad probability.
Max value in the discrete r.v. range:
Gamma parameter: gam[,1]
indicates the faking good parameter gam[,2]
indicates the faking bad parameter
Delta parameter: del[,1]
indicates the faking good parameter del[,2]
indicates the faking bad parameter
A character string
indicating the model for the conditional replacement distribution. The options are: uninformative
(default option) [gam = c(1,1)
and del = c(1,1)
]; average
[gam = c(3,3)
and del = c(3,3)
];
slight
[gam = c(1.5,4)
and del = c(4,1.5)
]; extreme
[gam = c(4,1.5)
and del = c(1.5,4)
].
Gives the conditional probability distribution based on the following equation
dgBetaD
) with bounds
Lombardi, L., Pastore, M. (2014). sgr: A Package for Simulating Conditional Fake Ordinal Data. The R Journal, 6, 164-177.
Pastore, M., Lombardi, L. (2014). The impact of faking on Cronbach's Alpha for dichotomous and ordered rating scores. Quality & Quantity, 48, 1191-1211.
# NOT RUN {
x <- 1:7
GA <- c(1,3,1.5,8); DE <- c(1,3,4,2.5)
### fake good
par(mfrow=c(2,2))
for (j in 1:4) {
y <- NULL
for (i in x) y <- c(y,pfake(x[i],h=4,Q=7,
gam=c(GA[j],GA[j]),del=c(DE[j],DE[j]),p=c(.4,0)))
plot(x,y,type="h",panel.first=points(x,y,pch=19),
main=paste("gamma=",GA[j]," delta=",DE[j],sep=""),ylim=c(0,.7),
ylab="Replacement probability")
}
### fake bad
for (j in 1:4) {
y <- NULL
for (i in x) y <- c(y,pfake(x[i],h=4,Q=7,
gam=c(GA[j],GA[j]),del=c(DE[j],DE[j]),p=c(0,.4)))
plot(x,y,type="h",panel.first=points(x,y,pch=19),
main=paste("gamma=",GA[j]," delta=",DE[j],sep=""),ylim=c(0,.7),
ylab="Replacement probability")
}
### fake good and fake bad
P = c(.4,.4)
par(mfrow=c(2,4))
for (j in x) {
y <- NULL
for (i in x) {
y <- c(y,pfake(x[i],h=x[j],Q=max(x),gam=c(GA[1],GA[1]),del=c(DE[1],DE[1]),p=P))
}
plot(x,y,type="h",panel.first=points(x,y,pch=19),
main=paste("h=",x[j],sep=""),ylim=c(0,1),
ylab="Replacement probability")
print(sum(y,na.rm=TRUE))
}
### using the fake.model argument
x <- 1:5
models <- c("uninformative","average","slight","extreme")
par(mfrow=c(2,2))
for (j in 1:4) {
y <- NULL
for (i in x) y <- c(y,pfake(x[i],h=2,Q=max(x),
fake.model=models[j],p=c(.45,0))) # fake good
plot(x,y,type="h",panel.first=points(x,y,pch=19),
main=paste(models[j],"model"),ylim=c(0,1),
ylab="Replacement probability")
}
par(mfrow=c(2,2))
for (j in 1:4) {
y <- NULL
for (i in x) y <- c(y,pfake(x[i],h=4,Q=max(x),
fake.model=models[j],p=c(0,.45))) # fake bad
plot(x,y,type="h",panel.first=points(x,y,pch=19),
main=paste(models[j],"model"),ylim=c(0,1),
ylab="Replacement probability")
}
# }
Run the code above in your browser using DataLab