Clogit R Log Odds Continuous Variable Plot

Hello there,

I have performed a conditional logistic regression in R using the survival package, but I am not certain how to interpret my results - I am very new to stats and R.

A quick explanation of my data: I am looking at the predation on a particular resource called a gall (found on goldenrods) by avian predators: chickadees and woodpeckers. I performed clogit because I wanted to stratify my data by plot, so I could see if the predators discriminate based on gall size within plots. I predicted that birds would ignore the galls that are smaller relative to the rest in the plot, and eat the larger ones.

So "Used" was input as 0s (not used) and 1s (used), then there was a size corresponding to each one. Here's the output of my clogit in R:

Code:

                                                  Call: clogit(Used ~ Size + strata(Plot), data = galldata)         coef exp(coef) se(coef)   z       p Size 0.473       1.6   0.0762 6.2 5.7e-10  Likelihood ratio test=58.2  on 1 df, p=2.38e-14  n= 253, number of events= 141                      

I was told that if the "coef" value is positive then it means predators are selecting for larger galls. Is this true? How can I word this properly? And is the p-value relevant for my results?

Any help would be appreciated. Thanks!

Last edited:

rogojel

hi,
the term exp(coef) is giving the odds ratio for an increase of 1 unit in the independent variable. In your case the odds ratio is 1.6 meaning that the odds of the monitored event ( Use) happening increase by 60% for an increase of 1 in the variable Size,

The p- value is importamt because a low value tells you that this increase in odds is very probably not a chance effect you see only because of the random sampling.

regards

hi,
the term exp(coef) is giving the odds ratio for an increase of 1 unit in the independent variable. In your case the odds ratio is 1.6 meaning that the odds of the monitored event ( Use) happening increase by 60% for an increase of 1 in the variable Size,

The p- value is importamt because a low value tells you that this increase in odds is very probably not a chance effect you see only because of the random sampling.

regards

Thanks for your response.

So does that mean the term "coef" is useless?

Also, when you say the odds of Use happening increase by 60%, could that mean in either direction (used OR unused)? If so, then how can I conclude anything about predator preference for size with that information? If it means only in the used direction then that makes sense and is consistent with my prediction...

Hello there,

I have performed a conditional logistic regression in R using the survival package, but I am not certain how to interpret my results - I am very new to stats and R.

A quick explanation of my data: I am looking at the predation on a particular resource called a gall (found on goldenrods) by avian predators: chickadees and woodpeckers. I performed clogit because I wanted to stratify my data by plot, so I could see if the predators discriminate based on gall size within plots. I predicted that birds would ignore the galls that are smaller relative to the rest in the plot, and eat the larger ones.

So "Used" was input as 0s (not used) and 1s (used), then there was a size corresponding to each one.

In case anyone else happens to read this post and wants to help, I'm having another issue with clogit for this data.

I have two predators that I am looking at, so I have another column in the raw data called "Type" with a letter for each type (C, W, and N for chickadee, woodpecker, or none). I want to perform the clogit but ALSO differentiate between the types of predators. What I've input for that is:

> clogit (Used~Size+Size:Type+strata(Plot),data=galldata)

First off, I want to know if that is the correct code/command to find what I am looking for? But then it also gives me output with this warning message:

Warning message:
In fitter(X, Y, strats, offset, init, control, weights = weights, :
Ran out of iterations and did not converge

I have tried googling the problem but it is difficult to understand what it means and how to fix it in my particular case.

Any input on the above would be so helpful!

I can take a look at the problem if you can upload code and data

I can take a look at the problem if you can upload code and data

That would be awesome!

I've attached the raw data (as a .xls file but I use .csv in R).

Here is the code:

Code:

                      > library(survival) > galldata<-read.csv(file.choose(),header=T) > clogit(Used~Size+Size:Type+strata(Plot),data=galldata) Call: clogit(Used ~ Size + Size:Type + strata(Plot), data = galldata)                coef exp(coef) se(coef)         z p Size        0.773     2.167     2962  0.000261 1 Size:TypeN -1.282     0.278      720 -0.001780 1 Size:TypeW -0.115     0.892      833 -0.000138 1  Likelihood ratio test=116  on 3 df, p=0  n= 142, number of events= 100  Warning message: In fitter(X, Y, strats, offset, init, control, weights = weights,  :   Ran out of iterations and did not converge                    

All of the plots contain every type of predation (NA, C, or W) so that should not be a problem. Any guidance you can offer would help.

In addition, I've tried something new because I couldn't fix this problem. I decided to perform clogit using ONLY plots with C and W, to see if they discriminated gall size within plots. Here is the code and output for that:

Code:

                      > galldataCW<-read.csv(file.choose(),header=T) > clogit(Used~Size+strata(Plot),data=galldataCW) Call: clogit(Used ~ Size + strata(Plot), data = galldataCW         coef exp(coef) se(coef)   z      p Size 0.255      1.29   0.0879 2.9 0.0037  Likelihood ratio test=9.52  on 1 df, p=0.00203  n= 132, number of events= 75                    

So based on those results and what rogojel said, it means that for every increase of 1 in Size, odds of the monitored event happening increase by 29%. But does this mean odds increase by 29% of galls being eaten by C, or by W? And which p-value is the important one, the one for "Size" or the one for the "Likelihood ratio test"? Sorry for the ignorant questions.

Again, any help would be appreciated! Please let me know if anything I explained needs clarification.

I will look at it tomorrow time is 3 at night here now .... but initial run give the same error message although the syntax appears fine ... problem could be to small data set.

I will look at it tomorrow time is 3 at night here now .... but initial run give the same error message although the syntax appears fine ... problem could be to small data set.

Great, thank you so much JesperHP! My presentation is on Tuesday (Ontario time) so I still have some time as it is only Sunday night here, but if I can figure this out before then that would be ideal.

Indeed it could be the small dataset... if that is the case, any clarification on the second part of my question (the meaning of the output for the second test for data galldataCW) would help a lot. I am assuming it means that predator size preferences do in fact differ within plots, but I do not want to present false information to my audience simply because I have misunderstood the output.

Thanks again, I appreciate your assistance!

rogojel

So does that mean the term "coef" is useless?

Also, when you say the odds of Use happening increase by 60%, could that mean in either direction (used OR unused)?.

Hi,
the coef is not "useless" as such, more like an intermediary result you need to get to the odds ratio.

The direction of the effect is given, the odds of getting a 1 in the Use variable increase by 60% by an increase of one unit of Size, so the effect is positive, determined by the sign of the coefficient ( or, if you will, by whether the odds ratio is greater or smaller then 1)

Just be careful, that the odds are not exactly probabilities and the odds ratios even less.

I'm not able to solve the problem or find any conclusive answer as to why >>Ran out of iterations and did not converge<< happens ... The same problem appears when using glm(,link=binomial) - that is another way to run a logistic regression. This suggests that the problem do not stem from wrong model specification by means of the formula object

Used~Size+Size:Type+strata(Plot)

. So I am tilting towards to small a dataset.

Rogojel #9 has already elaborated on the interpretation so I will leave the interpretation part to him :) .

Great, thank you both so much. Everything is a lot more clear now.
I appreciate your help!

mixonwhosseem.blogspot.com

Source: https://www.talkstats.com/threads/conditional-logistic-regression-help-with-interpreting-results.60196/

0 Response to "Clogit R Log Odds Continuous Variable Plot"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel