Description Usage Arguments Details Value Note Author(s) References See Also Examples
Calculate intra-group phi for one set of simulated participants who use
the number of categories specified in numcat
but who otherwise
respond randomly.
1 | phi.intra.chance(iter = 1, numcat, nitems, missing=NULL)
|
iter |
Dummy variable; value is ignored |
numcat |
vector of integers; each integer is the number of categories produced by one simulated participant |
nitems |
integer; the number of stimulus items in the free sort set |
missing |
vector of integers; each integer is the number of items not classified by one simulated participant |
Calculates phi.intra
for a set of simulated participants
who free sort the number of stimuli specified by nitems
into
the number of categories specified in numcat
, but who otherwise
respond randomly.
numcat
should include one integer value for each simulated
participant. For example, if you wish to simulate five participants,
three of whom use 9 groups and the remainder who use 12 groups, then:
numcat <- c(9,9,9,12,12)
The order of the numbers within the vector is irrelevant and is
ignored. Function calc.numcat
returns numcat
from a data
frame of free sort data in the format described in dataset
lawson
.
missing
is optional but, if specified, must include one integer
value for each simulated participant. The number specifies the number
of items not classified by that participant. For example, if you wish
to simulate five participants, three of whom classified all the items,
but two of whom missed 3 and 5 items respectively, then:
missing <- c(0,0,0,3,5)
The order of the numbers within the vector must correspond to the
order of numbers in numcat
. So, in the above examples, the
three simulated participants who used nine groups classified all the
items (zero missing items). The algorithm randomly selects which items
are not classified for each participant.
The main use of the phi.intra.chance
function is in the Monte
Carlo estimation of the chance level of the phi.intra statistic; an
example of usage is given below.
The phi.intra metric is based on Cramer (1946), slightly developed by Wills & McLaren (1998), and first employed in its current form by Haslam et al. (2007).
The particular Monte Carlo method of estimating the chance level of phi intra was first reported by Haslam et al. (2007). The Appendix of Lawson et al. (2017) provides a brief tutorial.
Phi.intra; a number ranging between 0 and 1.
This calculation assumes that all participants classify all items,
i.e. that nitems
is correct for all participants.
Andy J. Wills (andy@willslab.co.uk)
Cramer, H. (1946). Mathematical models of statistics. Princeton, NJ: Princeton University Press.
Haslam, C., Wills, A.J., Haslam, S.A., Kay, J., Baron, R. & McNab, F. (2007). Does maintenance of colour categories rely on language? Evidence to the contrary from a case of semantic dementia. Brain and Language, 103, 251-263.
Lawson, R., Chang, F. & Wills, A.J. (2017). Free classification of large sets of everyday objects is more thematic than taxonomic. Acta Psychologica, 172, 26-40.
Wills, A.J. & McLaren, I.P.L. (1998). Perceptual learning and free classification. Quarterly Journal of Experimental Psychology, 51B, 235-270.
phi.intra
, calc.numcats
, sig.con
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Estimate phi.intra chance level for 'words' group of 'lawson'
## dataset, using 10 iterations.
data(lawson)
edta <- lawson[lawson$ExptGroup == 2,]
x <- calc.numcats(edta)
iterate <- 10
mc <- sapply(1:iterate,phi.intra.chance,numcat=x,nitems=140)
mean(mc)
sig.con(0.7,mean(mc))
## In practice, a much larger number of iterations should be used.
## Lawson et al. (2016) use 1e5 iterations.
## At 1e5 iterations this function is very slow. The function has not
## yet been optimised, so peformance may improve in future versions of
## the package.
## If you have a multi-core processor (or Beowulf cluster), speed of
## calculation can be dramatically increased by use of the 'sfSapply'
## function in the 'snowfall' package. Example code follows:
## library(snowfall)
## library(rlecuyer)
## sfInit(parallel=TRUE,cpus=4,type="SOCK")
## sfClusterSetupRNG()
## iterate <- 40
## mc <- sfSapply(1:iterate,phi.intra.chance,numcat=x,nitems=140)
## mean(mc)
## sfStop()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.