Skip to content

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

3 messages · Brian Ripley, baud-bovy.gabriel at hsr.it

#
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
#
On Sat, 16 Dec 2006, baud-bovy.gabriel at hsr.it wrote:

            
Yes.
Looking at make.link() should give you enough to go on.
For gee, you need to change the C-level internals. (I've done this in the 
far past for S-PLUS but not for R.)  It would be easier to use yags (but I 
think you still need to dive into the internals).

What 'glmm' did you have in mind?  Looks like e.g. glmmML and glmmPQL will 
work with the new link.

[...]

Someone may have been here already: e.g.
http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=1434755
#
At 07:01 AM 12/16/2006, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:

            
Thank you for your reply and the above link. I am not sure yet which
function to use.  I am new at logistic regression for repeated-measure
designs and its various implementations in R.

glmmML seems to require changes at the C-level:
<http://www.stat.umu.se/forskning/reports/glmmML.pdf>http://www.stat.umu.se/forskning/reports/glmmML.pdf 


The new link might apparently be added to glmmPQL entirely at the
R-level.
If I understood your suggestion well, it is sufficient to add a new
link for the binomial family by extending the make.link function
and adding, say, a "half-logit" link (both for the glm and lme call in
glmPQL).

Then, the call to glmmPQL could be

glmmPQL(resp~shape*ecc*kappa,
         random=~1|subject,
         family=binomial("half-logit"),
         data,
         correlation=corCompSymm(form=~1|subject))

assuming that resp=1 if response is correct and 0 otherwise,
a random intercept (as in glmmML) and an "exchangeable" correlation structure.

Note that it might be better to specify a "random slope" in
this context (since proportions are expected to vary between 0.5 and 1
for all subjects, the main difference being that some subjects might
have a steeper S-shaped curve than others) but I am not sure how to do it.

Regards,

Gabriel Baud-Bovy
UHSR University, Milan, Italy