[R] how to adjust link function in logistic regression to predict the proportion of correct responses in 2AFC task?

baud-bovy.gabriel at hsr.it baud-bovy.gabriel at hsr.it
Sat Dec 16 01:57:25 CET 2006


I have would like to use logistic regression to analyze the
percentage of correct responses in a 2 alternative forced
choice task. The question is whether one needs to take into
account the fact expected probabilities for the percentage of
correct responses ranges between 0.5 and 1 in this case and
how to adjust the link function accordingly in R (see details below).

Gabriel

Subjects were asked to match a tactile stimulus
(shape A or B) with a visual template (response a or b).
The exact stimulus properties depended on the
experimental factors ecc (3 levels: 0.4, 0.7 and 1.0)
and kappa (also 3 levels:  0.75, 1, 1.25), which yielded
nine experimental conditions. Five subjects participated
to the experiment and each stimulus was presented 10 times
in each experimental condition.

The following table reports the pooled responses of the
5 subjects.

     |       |           kappa          |
     |       |  0.75      1.0     1.25  |
ecc | shape +--------+--------+--------+
     |       |  resp  |  resp  |  resp  |
     |       |  a   b |  a   b |  a   b |
----+-------+--------+--------+--------+
0.4 |   A   |  41  9 |  38 12 | 35  15 |
     |   B   |   3 47 |   7 43 | 11  39 |
----+-------+--------+--------+--------+
0.7 |   A   |  22 28 |  33 17 | 39  11 |
     |   B   |  10 40 |  21 29 | 24  26 |
----+-------+--------+--------+--------+
1.0 |    A   |  26 24 |  26 24 | 28  22 |
     |   B   |  20 30 |  18 32 | 25  25 |
----+-------+--------+--------+--------+

For this analysis, I define "correct response" as
the resp=a for shape=A and resp=b for shape=B.
The proportions of correct responses are therefore:

     |       |           kappa          |
ecc | shape |  0.75      1.0     1.25  |
----+-------+--------+--------+--------+
0.4 |   A   |  0.82  |  0.76  |  0.70  |
     |   B   |  0.94  |  0.86  |  0.78  |
----+-------+--------+--------+--------+
0.7 |   A   |  0.44  |  0.66  |  0.78  |
     |   B   |  0.80  |  0.58  |  0.52  |
----+-------+--------+--------+--------+
1.0 |    A   |  0.52  |  0.52  |  0.56  |
     |   B   |  0.60  |  0.62  |  0.50  |
----+-------+--------+--------+--------+

The proportion of correct response is the
largest for ecc=0.4 and, in general, smallest
for ecc=1 as expected. It was expected that
proportions of correct response would be
close to 0.5 when ecc=1 because shapes
A and  B were the same in this condition.

I would like to use the logistic regression
to assess the effect of the shape, ecc and kappa
on the proportion of correct responses. For example,

glm(resp~shape*ecc*kappa,data=data,link=binomial)

or, better,

gee(resp~shape*ecc*kappa,id=subject,data=data,family=binomial,
         corstr = "exchangeable")

given the fact that data that are correlated because
the 50 responses come from five subjects.
My first question is rather statistical: do I need to
take into account the fact that the values of these proportions
are expected to range in the interval [0.5-1] (0.5 corresponding
to a random response) ? It seems to me that some sort
of correction is needed as it is the case when one fits
a psychometric function to this type of data (e.g. probit
is rescaled to fit inside the [0.5-1] interval and the absolute
threshold is defined as the point where the probit reaches
the 0.75 probability level).

Second, how can one implement a link function of the
type f(x) = (1+exp(x)/(1+exp(x)))/2 in R?

Third, can it be also done with gee and/or glmm?

---------------------------------------------------------------------
Gabriel Baud-Bovy               tel.: (+39) 02 2643 4839 (office)
UHSR University                       (+39) 02 2643 3429 (laboratory)
via Olgettina, 58                     (+39) 02 2643 4891 (secretary)
20132 Milan, Italy               fax: (+39) 02 2643 4892



More information about the R-help mailing list