polynomial logistic regression - prey predator relationship

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

polynomial logistic regression - prey predator relationship

Nabaneeta Saha
Dear Everybody,
      I am a researcher working in ecology. I work on prey-predator
relationships. I am striving to analyze a part of my data. I am finding it
difficult to differentiate between Type II and Type III functional
responses. I have seen references where a polynomial logistic regression
model is used to determine the shape of functional response curve by
taking into consideration the proportion of prey eaten (Na/No) as a
function of prey offered (No). The data needs to fitted
to a polynomial function that describes the relationship between Na / No
and No:
Na/No=exp (Po + P1No + P2No2 + P3No3)/1 + exp (Po + P1No + P2No2 + P3No3)

I need to figure out the parameters estimates Po, P1, P2, and P3 using the
method of maximum likelihood.

If, I arrange the variables in this way:
No  Replicate  Fate   Na
5      1        0      1
5      1        0      4
5      2        1      2
5      2        1      3
10     1        0      5
10     1        0      5
10     2        1      7
10     2        1      3
Here,I considered two datalines for each replicate,Fate = 0 prey eaten;
Fate = 1 prey alive; for a given replicate Na sums to No.

Am I correct in arranging the data structure for a logistic regression?
Could anyone kindly give me any suggestions of how to analyze this in SPSS.

Thank you for your help and suggestions.

Nabaneeta Saha
University of Calcutta.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: polynomial logistic regression - prey predator relationship

Marta Garcia-Granero
Nabaneeta Saha wrote:

>       I am a researcher working in ecology. I work on prey-predator
> relationships. I am striving to analyze a part of my data. I am finding it
> difficult to differentiate between Type II and Type III functional
> responses. I have seen references where a polynomial logistic regression
> model is used to determine the shape of functional response curve by
> taking into consideration the proportion of prey eaten (Na/No) as a
> function of prey offered (No). The data needs to fitted
> to a polynomial function that describes the relationship between Na / No
> and No:
> Na/No=exp (Po + P1No + P2No2 + P3No3)/1 + exp (Po + P1No + P2No2 + P3No3)
>
> I need to figure out the parameters estimates Po, P1, P2, and P3 using the
> method of maximum likelihood.
>
> If, I arrange the variables in this way:
> No  Replicate  Fate   Na
> 5      1        0      1
> 5      1        0      4
> 5      2        1      2
> 5      2        1      3
> 10     1        0      5
> 10     1        0      5
> 10     2        1      7
> 10     2        1      3
> Here,I considered two datalines for each replicate,Fate = 0 prey eaten;
> Fate = 1 prey alive; for a given replicate Na sums to No.
>
I don't think I understand your data layout. You say that Na is the
number of prey eaten, and that fate=0 means that the prey was eaten, but
1) for replicate number 2 (rows 3&4), both lines indicate that the prey
is alive (fate=1), therefore, Na should be 0 for those lines.
2) For replicate number 1 (rows 1&2), both lines indicate that the preys
were eaten, why do you have the information split in two?
3) Why are replicate numbers repeated (1 1 2 2 1 1 2 2...instead of 1 1
2 2 3 3 4 4 ...)?

Could it be that for every replicate, first line indicates number of
prey eaten (fate=0) and second line indicates number NOT eaten (fate=1)?

This doesn't make sense to me. Please, explain with more detail, or we
will not be able to help.

Regards,
Marta

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: polynomial logistic regression - prey predator relationship

Marta Garcia-Granero
Nabaneeta Saha wrote:

I am sorry, I had made the mistake. It should be like this:

No

Replicate

Fate

Na

5

1

0

1

5

1

1

4

5

2

0

2

5

2

1

3

10

1

0

5

10

1

1

5

10

2

0

7

10

2

1

3

I considered two datalines for each replicate, Fate = 0 prey eaten;  Fate = 1; prey alive

So in replicate 1:

if I consider the situation Fate =0 then Na is 1

if I consider the situation Fate =1 then Na is 4

(because the total prey present was 5, for a given replicate Na sums to No).

I started the replicate number from 1 for each prey density (at prey density with 2 replicates). This is only a part of my data, I conducted the experiment with 6 prey densities with10 replicates at each prey density. I basically found this data structure here
http://www.oup-usa.org/sc/0195131878/c10_data_ex1.html where they have used SAS for analysis, for a similar experiment.
 
I took a look at a book (see ref. below), and they used 1=prey eaten and 0=prey alive (better, since you want to run a logistic regression model. Also, they used NLR with SPSS, you can get something close to what they did (with the exception that they used ML for estimation, instead of the default method used by NLR minimizing the residual SS).

With your dataset, I think that both approaches (logistic regression and NLR) can be used. Complete your dataset (for every No), since the syntax doesn't work with justtwo values (5&10, they ones you provide):
* http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=1283886 *.

* Get this document: Juliano SA. 2001. Non-linear curve fitting: Predation and functional response curves.
* In: Scheiner SM and Gurevitch J, editors. Design and analysis of ecological experiments. 2nd edition. 178–196.
* New York: Chapman and Hall.

DATA LIST LIST/No Replicate Fate Na (4 F8).
BEGIN DATA
5      1        1      1
5      1        0      4
5      2        1      2
5      2        0      3
10     1        1      5
10     1        0      5
10     2        1      7
10     2        0      3
END DATA.

WEIGHT by Na.

* With NLR *.
COMPUTE Ratio = Na / No .
FILTER BY Fate .

* NonLinear Regression (cubic model).
Set Printback on.
MODEL PROGRAM P0=0 P1=0 P2=0 P3=0 .
COMPUTE PRED_=EXP(P0+P1*No+P2*No**2+P3*No**3)/(1+EXP(P0+P1*No+P2*No**2+P3*No**3)).
_set Printback off.
NLR Ratio
  /OUTFILE='C:\Temp\SPSSFNLR.TMP'
  /PRED PRED_
  /SAVE PRED
  /CRITERIA SSCONVERGENCE 1E-8 PCON 1E-8 .

* NonLinear Regression (quadratic model, since many times P3=0).
Set Printback on.
MODEL PROGRAM P0=0 P1=0 P2=0.
COMPUTE PRED_=EXP(P0+P1*No+P2*No**2)/(1+EXP(P0+P1*No+P2*No**2)).
_set Printback off.
NLR Ratio
  /OUTFILE='C:\Temp\SPSSFNLR.TMP'
  /PRED PRED_
  /SAVE PRED
  /CRITERIA SSCONVERGENCE 1E-8 PCON 1E-8 .

* With polynomial logistic regression *.
FILTER OFF.
COMPUTE No2=No**2.
COMPUTE No3=No**3.
LOGISTIC REGRESSION VARIABLES  Fate
  /METHOD = ENTER No No2 No3
  /SAVE = PRED
  /CRITERIA = PIN(.05) POUT(.10) ITERATE(20) CUT(.5) .

Ref: Juliano SA. 2001. Non-linear curve fitting: Predation and functional response curves.  In: Scheiner SM and Gurevitch J, editors. Design and analysis of ecological experiments. 2nd edition. 178–196. New York: Chapman and Hall.

HTH,
Marta

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: polynomial logistic regression - prey predator relationship

Marta Garcia-Granero
Nabaneeta Saha wrote:
> [...]
>
>>     I basically found this data structure here
>>     http://www.oup-usa.org/sc/0195131878/c10_data_ex1.html where they
>>     have used SAS for analysis, for a similar experiment.
>

Using that dataset, I have been able to replicate exactly the results
(available at http://www.oup-usa.org/sc/0195131878/c10_code_ex1.html)
using SPSS & LOGISTIC REGRESSION:

* Sample dataset *.
DATA LIST FREE/No Replicate Fate Na (4 F8).
BEGIN DATA
 5 1 0  0  5 1 1  5  5 2 0  1  5 2 1  4  5 3 0  1
 5 3 1  4  5 4 0  2  5 4 1  3  5 5 0  2  5 5 1  3
 5 6 0  2  5 6 1  3  5 7 0  2  5 7 1  3  5 8 0  3
 5 8 1  2  7 1 0  0  7 1 1  7  7 2 0  0  7 2 1  7
 7 3 0  1  7 3 1  6  7 4 0  1  7 4 1  6  7 5 0  2
 7 5 1  5  7 6 0  2  7 6 1  5  7 7 0  2  7 7 1  5
 7 8 0  3  7 8 1  4 10 1 0  1 10 1 1  9 10 2 0  1
10 2 1  9 10 3 0  2 10 3 1  8 10 4 0  2 10 4 1  8
10 5 0  3 10 5 1  7 10 6 0  3 10 6 1  7 10 7 0  3
10 7 1  7 10 8 0  4 10 8 1  6 10 9 0  7 10 9 1  3
15 1 0  1 15 1 1 14 15 2 0  1 15 2 1 14 15 3 0  3
15 3 1 12 15 4 0  3 15 4 1 12 15 5 0  4 15 5 1 11
15 6 0  5 15 6 1 10 15 7 0  5 15 7 1 10 15 8 0  5
15 8 1 10 20 1 0  3 20 1 1 17 20 2 0  4 20 2 1 16
20 3 0  7 20 3 1 13 20 4 0  7 20 4 1 13 20 5 0  8
20 5 1 12 20 6 0  8 20 6 1 12 20 7 0  9 20 7 1 11
20 8 0 11 20 8 1  9 25 1 0  4 25 1 1 21 25 2 0  5
25 2 1 20 25 3 0  6 25 3 1 19 25 4 0  7 25 4 1 18
25 5 0  9 25 5 1 16 25 6 0  9 25 6 1 16 25 7 0 13
25 7 1 12 25 8 0 14 25 8 1 11 30 1 0  5 30 1 1 25
30 2 0  8 30 2 1 22 30 3 0 10 30 3 1 20 30 4 0 11
30 4 1 19 30 5 0 11 30 5 1 19 30 6 0 12 30 6 1 18
30 7 0 14 30 7 1 16 30 8 0 20 30 8 1 10 45 1 0  4
45 1 1 41 45 2 0  7 45 2 1 38 45 3 0  8 45 3 1 37
45 4 0 10 45 4 1 35 45 5 0 11 45 5 1 34 45 6 0 14
45 6 1 31 45 7 0 15 45 7 1 30 45 8 0 19 45 8 1 26
60 1 0  9 60 1 1 51 60 2 0 14 60 2 1 46 60 3 0 14
60 3 1 46 60 4 0 16 60 4 1 44 60 5 0 18 60 5 1 42
60 6 0 21 60 6 1 39 60 7 0 24 60 7 1 36 60 8 0 26
60 8 1 34 80 1 0  7 80 1 1 73 80 2 0 11 80 2 1 69
80 3 0 12 80 3 1 68 80 4 0 15 80 4 1 65 80 5 0 17
80 5 1 63 80 6 0 12 80 6 1 68 80 7 0 21 80 7 1 59
80 8 0 23 80 8 1 57   100 1 0  7 100 1 1 93 100 2 0  8
100 2 1 92 100 3 0 10 100 3 1 90 100 4 0 11 100 4 1 89
100 5 0 15 100 5 1 85 100 6 0 24 100 6 1 76 100 7 0 26
100 7 1 74 100 8 0 33 100 8 1 67
END DATA.

* Reverse the recoding of fate (it is 0=eaten/1=alive and we need
0=alive/1=eaten) *.
RECODE Fate (0=1) (1=0).
LIST VARIABLES=ALL /CASES=FROM 1 TO 10.

* Changing 0 to 1e-6 in Na to avoid warning message when weighting *.
RECODE Na (0=0.000001).

* Logistic regression *.
WEIGHT by Na.
COMPUTE No2=No**2.
COMPUTE No3=No**3.
LOGISTIC REGRESSION VARIABLES  Fate
  /METHOD = ENTER No No2 No3
  /SAVE = PRED.

* Graph model *.
WEIGHT OFF.
GRAPH
  /SCATTERPLOT(BIVAR)=No WITH PRE_1.

HTH,
Marta GG

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD