-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pairs analyses? #54
Comments
@davharris I'll let @ngotelli chime in there because he knows this literature way better than I do. |
Hi @davharris, sorry to be out of touch. but I have been busy with grading. Yes, I would love to be able to have a PAIRS analysis in EcoSimR. You might want to check out the older branch by Adam Clarke, as I think he may have been working on this as well. I didn't have time to really run your code, but here are a few comments for now:
p.upper <- mean(x <= null)
p.lower <- mean(x >= null) For species pairs with low row totals, the chances of a tie are very large, so it is important to have each inequality include the equals case.
That's all for now, hope it helps. Thanks, Nick |
Thanks @ngotelli. I've played around with it a bit more, and I think I must be doing something wrong. If most species are rare, then most of the simulated landscapes involving a given pair will have no overlap, corresponding to a scaled C-score of 1. In one matrix I simulated (250 columns, average of 2-3 occurrences per species), 99.3% of the observed scores were 1 and 99.3% of the null scores were also 1. Long story short, using a completely random matrix, I ended up with almost 99% of observed values matching the upper limit of 1. If I'm understanding correctly, that's a Type I error rate of 99%. Any idea what's going on? |
Hi @davharris. Sorry to be out of touch. It sounds like you are missing some of the steps needed for the empirical Bayes approach:
The Gotelli and Ulrich (2010) paper gives more details. But from your code, I don't see that you have worked up the mean and confidence interval of species pair per bin for the null assemblages. That's what you need next. Hope that helps. |
Hi Nick, thanks for the response.
Thanks again for thinking this through with me. Dave
|
Hi Dave:
http://www.uvm.edu/~ngotelli/homepage.html
http://www.uvm.edu/~ngotelli/musicpage/music.html
http://www.uvm.edu/~ngotelli/EcoSim/EcoSim.html Links:[1] #54 (comment) |
Hi @ngotelli, hope you had a great weekend. I was wondering, could you run Pairs on this data set and post the output? The first 18 species were generated randomly, then the 19th and 20th species were added as either a copy or mirror-image of the 18th species. I think that a set of results on this data set would help me determine if the code I've written so far is on the right track. Thanks again for all your feedback, Dave |
@davharris I ran PAIRS on this matrix with fixed-fixed and all the default settings, and pushed the output files to you. |
Thanks @ngotelli. I don't see the output files, though? Could you post a link to them or send me an email? Thanks again. |
Sorry. I tried to push my results to you, but I don't have permission.
http://www.uvm.edu/~ngotelli/homepage.html
http://www.uvm.edu/~ngotelli/musicpage/music.html
http://www.uvm.edu/~ngotelli/EcoSim/EcoSim.html Links:[1] https://github.com/ngotelli
Species site1 site2 site3 site4 site5 site6 site7 site8 site9 site10 site11 site12 site13 site14 site15 site16 site17 site18 site19 site20 site21 site22 site23 site24 site25 site26 site27 site28 site29 site30 site31 site32 site33 site34 site35 site36 site37 site38 site39 site40 site41 site42 site43 site44 site45 site46 site47 site48 site49 site50 site51 site52 site53 site54 site55 site56 site57 site58 site59 site60 site61 site62 site63 site64 site65 site66 site67 site68 site69 site70 site71 site72 site73 site74 site75 site76 site77 site78 site79 site80 site81 site82 site83 site84 site85 site86 site87 site88 site89 site90 site91 site92 site93 site94 site95 site96 site97 site98 site99 site100 Packed matrix: m.txt
sp20 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 93
Last packed randomized matrix: m.txt No. of Swaps: 20000
sp20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 93
Species site17 site31 site49 site77 site84 site85 site93 site97 site28 site11 site41 site47 site6 site50 site51 site63 site66 site18 site20 site21 site87 site88 site91 site23 site27 site1 site15 site52 site58 site59 site60 site61 site62 site29 site30 site71 site72 site73 site75 site76 site16 site78 site79 site82 site83 site39 site7 site43 site44 site89 site45 site92 site24 site94 site95 site96 site26 site98 site99 site8 site32 site33 site34 site64 site65 site35 site67 site68 site69 site70 site36 site37 site38 site74 site19 site40 site9 site42 site10 site80 site81 site22 site4 site46 site12 site86 site48 site25 site13 site90 site14 site5 site53 site54 site55 site56 site57 site2 site3 site100
No Score ObsNumber ExpNumber StDevExp Skewness LowerCL UpperCL Z-Score OddsRMean OddsRCL No Sp1 Sp2 S1 S2 Com Obs.Score Exp.Score Exp.StDev Skewness LowerCL UpperCL Z-Score Alpha >MeanScore >CLScore >BJScore Alpha |
Thanks Nick! Dave
|
Sorry to bother you again, @ngotelli. It looks like Github truncated the pairwise matrix after only 46 of the 190 pairs. Maybe email would work better? Thanks again for looking into this for me. |
@davharris In the end, did you manage to check and implement a pairwise analysis correctly? |
Hi @emhart @ngotelli, hope you both had nice weekends.
My Windows box doesn't want to run Dr. Ulrich's binary (it thinks the .exe file might be a virus for some reason). I was wondering if either of you would be interested in looking at my implementation (below) and letting me know if it looks correct to you. If it does, I'd be happy to submit it as a pull request.
Thanks!
The text was updated successfully, but these errors were encountered: