phi.inter.rnd: Inter-group Phi for Randomized Groups

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Randomize group membership, and then calculate inter-group phi as per function phi.inter.

Usage

1
phi.inter.rnd(iter, grp1, grp2)

Arguments

iter

Dummy variable; value is ignored

grp1

A data frame, for the first group of participants, that includes the following columns: SjNo, CategoryNo, ItemNo, described below. Each row is one classification decision.

grp2

A data frame, for the second group of participants; format as for grp1.

Details

Dataset lawson provides an example of the format expected by the phi.inter function. For further details, see phi.inter.

The primary purpose of phi.inter.rnd is for Monte Carlo estimation of a chance level for phi.inter; an example of usage is given below.

The logic behind this calculation is that if two groups classify the stimulus set differently, their mean phi-inter will be lower than in the case where group membership is determined randomly.

If this is not apparent, consult the brief tutorial available in the Appendix of Lawson et al. (2017).

The phi-inter metric is based on Cramer (1946), slightly developed by Wills & McLaren (1998), and first employed in its current form by Lawson et al. (2017).

Value

Phi-inter; a number ranging between 0 and 1.

Author(s)

Andy J. Wills (andy@willslab.co.uk)

References

Cramer, H. (1946). Mathematical models of statistics. Princeton, NJ: Princeton University Press.

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.

See Also

phi.inter, sig.con

Examples

 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-inter chance level for the 'lawson' dataset, using 10
  ## iterations.

  data(lawson)
  grp1 <- lawson[lawson$ExptGroup == 1,]
  grp2 <- lawson[lawson$ExptGroup == 2,]
  iterate <- 10
  mc <- sapply(1:iterate,phi.inter.rnd,grp1=grp1,grp2=grp2)
  mean(mc)
  sig.con(0.6,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.inter.rnd,grp1=grp1,grp2=grp2)
  ## mean(mc)
  ## sfStop()

freesortphi documentation built on May 2, 2019, 5:54 p.m.