Re: [R-sig-eco] plot confidence interval binomial glm

2021-05-29 Thread Manuel Spínola
Hi Fernando,

You need to write:

plot_model(model2, type = "pred", terms = "Prey [all]"), show.data = TRUE)

Other packages:

visreg
ggeffects

Manuel

El sáb, 29 may 2021 a las 2:09, Luis Fernando García ()
escribió:

> Dear all,
>
> I am using the  sj Plot package, but I have had some issues when plotting.
> The main question I have is that when plotting a binomial GLM, lines are
> not smooth, but they look broken (see
>
> https://docs.google.com/presentation/d/1Pqm6BcJXdSQ6U1zmv5FV7gBcn1afHHv7rlQHe6j59_c/edit?usp=sharing
> ),
> I wanted to know if there is anyway to increase resolution? In addition, is
> it possible to add to this plot the individual observations (points)?
>
> I am sorry if this question is too obvious but I am just trying this
> package. In addition, do you know another package for plotting GLM
> confidence intervals?
>
> Best regards!
>
> CODE
> library(sjPlot:)
> library(ggplot2)
> model2 = glm(y~log(dose)+Prey,quasibinomial(link=probit))
> plot_model(model3, type = "pred", terms = c("ld","Prey"))
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] [EXTERNAL] Time to Independence in R

2021-03-03 Thread Manuel Spínola
Thank you very much Tom.

Manuel

El mié, 3 mar 2021 a las 15:35, Philippi, Tom ()
escribió:

> Manuel--
> I apologize in advance for not answering the exact question you ask about
> packages.  [It is included in some geostatistics packages in terms of
> semivariance, nugget, sill, etc.]
>
> In ecological data, time to independence is very scale dependent.  There's
> autocorrelation at scales of seconds due to instrument
> temperature-dependence if that hasn't been calibrated for, or the same
> individuals in the camera trap frame.  That component of dependence may
> have a half-life of minutes.  There's often autocorrelation based on time
> of day & temperature, with cycles of 24 hours.  There may be pulse events
> from storms that persist a few days.  There's seasonality driving
> temperatures, day lengths, and plant & animal behavior, with cycles of 1
> year.  Then where I live there are ENSO-driven temporal dependence at
> scales of 1.5 - 3 years, PDO at about a decade, and ENSO-La Nina dominated
> periods of 4-6 decades that drive not just ocean ecology, but rainfall &
> thus terrestrial ecology.  Then there's tends up to climate change.
>
> So, in my experience in optimizing sampling designs for monitoring for
> trends, the majority of the temporal dependence is driven by cycles or
> pulses of characteristic duration, and that is more useful for determining
> the sampling frequency than empirical estimation form a "continuous"
> datastream of limited duration.  That approach also helps me think about
> the spatial concordance of the correlated errors: which are site-specific,
> which are concordant across all of the sites.
>
> Tom
>
> -Original Message-
> From: R-sig-ecology  On Behalf Of
> Manuel Spínola
> Sent: Wednesday, March 3, 2021 1:06 PM
> To: r-sig-ecology@r-project.org
> Subject: [EXTERNAL] [R-sig-eco] Time to Independence in R
>
>
>
>  This email has been received from outside of DOI - Use caution before
> clicking on links, opening attachments, or responding.
>
>
>
> Dear list members,
>
> It is common in ecology to sampling in almost a continuous manner when
> using data loggers, camera traps, sound recorders, gps radio-collars. etc.
>
> Is there any R package to assess time to independence for the data to
> avoid temporal autocorrelation?
>
> I know that there are models to take into account the temporal
> autocorrelation of the data, but I am asking to optimize the data
> collection, before modeling.
>
> Thank you very much in advance.
>
> Manuel
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA mspin...@una.cr
>  mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsites.google.com%2Fsite%2Flobitoderio%2F&data=04%7C01%7Ctom_philippi%40nps.gov%7C7c92bae61c0d458d045908d8de8881b0%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637504025171590082%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qTaPgnDdCNuCtww7koY%2F7StrjYRczIa2YNZiNveJo%2FQ%3D&reserved=0
> >
> Institutional website: ICOMVIS <
> https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.icomvis.una.ac.cr%2F&data=04%7C01%7Ctom_philippi%40nps.gov%7C7c92bae61c0d458d045908d8de8881b0%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637504025171600039%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=X589QmEcCyNjUYSFnebVym2vx6pn%2Fyg5oyX8vZ0fSOQ%3D&reserved=0
> >
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
>
> https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-ecology&data=04%7C01%7Ctom_philippi%40nps.gov%7C7c92bae61c0d458d045908d8de8881b0%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637504025171600039%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=kPnj2hOk7NHbscFpSMuSkQvqrVBymYw2Eb7XeSrmDp0%3D&reserved=0
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Time to Independence in R

2021-03-03 Thread Manuel Spínola
Dear list members,

It is common in ecology to sampling in almost a continuous manner when
using data loggers, camera traps, sound recorders, gps radio-collars. etc.

Is there any R package to assess time to independence for the data to avoid
temporal autocorrelation?

I know that there are models to take into account the temporal
autocorrelation of the data, but I am asking to optimize the data
collection, before modeling.

Thank you very much in advance.

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Appropriate model parameterization in lme4 for spatio-temporal structured data

2021-01-19 Thread Manuel Spínola
Dear list members,

I have an ecological data set, and I want to account for the
spatio-temporal structure of my data:

metric = response variable (continuous)
zone = 3 zones (A, B and C)
location = 12 sampling locations per zone
min = minute
hour = hour
day = day

metric zone location minute hour day
2.4 A  1A 11 1
2.7.A. 1A 211

1.7.C  1C.   45   35


If I want to compare the metric among the 3 zones, is it the following an
appropriate model parameterization in lme4?:

mod_01 <- lmer(metric ~ zone + (1 | location) + (1 | day/hour/min), data =
my_data)

Thank you very much in advance.

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Thank you very much Thierry.

Manuel

El jue., 18 jun. 2020 a las 13:06, Thierry Onkelinx (<
thierry.onkel...@inbo.be>) escribió:

> Dear Manuel,
>
> Our institute has published 54 datasets under an open data licence at GBIF
> (
> https://www.gbif.org/dataset/search?publishing_org=1cd669d0-80ea-11de-a9d0-f1765f95f18b
> )
>
> You can look for local data on GBIF too.
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
> FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkel...@inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> www.inbo.be
>
>
> ///
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to say
> what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
>
> ///////////
>
> <https://www.inbo.be>
>
>
> Op do 18 jun. 2020 om 19:58 schreef Manuel Spínola :
>
>> Thank you very much Rich.
>>
>> Yes, you are right, is a very broad spectrum.
>>
>> I teach mainly to wildlife ecology students.
>>
>> I was using several datasets from different sources for homeworks and
>> final projects, but some of the students were "sharing" the results of the
>> assignments so I decided to assign different datasets to each student for
>> their homeworks.  This means that I need several datasets for each
>> assignment, and the data need to be similar in the structure, for example,
>> logistic regression, the response variable needs to be binary, and so on.
>>
>> Manuel
>>
>>
>>
>> El jue., 18 jun. 2020 a las 11:41, Rich Shepard (<
>> rshep...@appl-ecosys.com>)
>> escribió:
>>
>> > On Thu, 18 Jun 2020, Manuel Spínola wrote:
>> >
>> > > I teach statistics to students in ecology and environmental sciences
>> > > fields and I would like to know if you could point me in the right
>> > > direction of sources of ecological/environmental datasets within and
>> > > outside packages, especially for general/generalized linear models and
>> > > multivariate statistics.
>> >
>> > Manuel,
>> >
>> > Ecology, and it's applied focus Environmental science, are very broad.
>> I've
>> > been working with these data for several decades so I need to ask what
>> > types
>> > of data you want.
>> >
>> > I don't know what's available from Costa Rican agencies but I do know
>> that
>> > in the US you can get geochemical, biological, hydrologidal, and other
>> data
>> > from the US Geological Survay, Environmental Protection Agency (if
>> they've
>> > not removed them), Department of Agriculture's Forest Service and
>> Natural
>> > Resources Conservation Service.
>> >
>> > You can also look at StreamNet run by the Pacific States Marine
>> Fisheries
>> > Council, The Army Corps of Engineers for hydraulic, flow, and sediment
>> > transport data.
>> >
>> > That's a start.
>> >
>> > Rich
>> >
>> > ___
>> > R-sig-ecology mailing list
>> > R-sig-ecology@r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>> >
>>
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr 
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Personal website: Lobito de río <
>> https://sites.google.com/site/lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Thank you very much Mollie.

Manuel

El jue., 18 jun. 2020 a las 14:12, Mollie Brooks ()
escribió:

>
>
> On 18Jun 2020, at 19:58, Manuel Spínola  wrote:
>
> Thank you very much Rich.
>
> Yes, you are right, is a very broad spectrum.
>
> I teach mainly to wildlife ecology students.
>
> I was using several datasets from different sources for homeworks and
> final projects, but some of the students were "sharing" the results of the
> assignments so I decided to assign different datasets to each student for
> their homeworks.  This means that I need several datasets for each
> assignment, and the data need to be similar in the structure, for example,
> logistic regression, the response variable needs to be binary, and so on.
>
>
> This specific example brings to mind…you could do presence/absence models
> with 8 species of salamanders in the Salamanders data set
> https://rdrr.io/cran/glmmTMB/man/Salamanders.html
>
> Depending on class sizes, it might be enough for every student to get a
> different species, or you could break it up even further into subsets of
> data.
>
> cheers,
> Mollie
>
>
> Manuel
>
>
>
> El jue., 18 jun. 2020 a las 11:41, Rich Shepard ( >)
> escribió:
>
> On Thu, 18 Jun 2020, Manuel Spínola wrote:
>
> I teach statistics to students in ecology and environmental sciences
> fields and I would like to know if you could point me in the right
> direction of sources of ecological/environmental datasets within and
> outside packages, especially for general/generalized linear models and
> multivariate statistics.
>
>
> Manuel,
>
> Ecology, and it's applied focus Environmental science, are very broad. I've
> been working with these data for several decades so I need to ask what
> types
> of data you want.
>
> I don't know what's available from Costa Rican agencies but I do know that
> in the US you can get geochemical, biological, hydrologidal, and other data
> from the US Geological Survay, Environmental Protection Agency (if they've
> not removed them), Department of Agriculture's Forest Service and Natural
> Resources Conservation Service.
>
> You can also look at StreamNet run by the Pacific States Marine Fisheries
> Council, The Army Corps of Engineers for hydraulic, flow, and sediment
> transport data.
>
> That's a start.
>
> Rich
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Thank you very much Michael.

Manuel

El jue., 18 jun. 2020 a las 12:36, Michael Mahoney (<
mike.mahoney@gmail.com>) escribió:

> Allison Horst has packaged data on penguin species from the PAL-LTER
> project at https://github.com/allisonhorst/palmerpenguins. This is a nice
> dataset for basic instruction -- 344 observations and 7 variables, so
> it's easily understandable but with enough complexity to at least introduce
> most concepts.
>
> Thanks,
>
> Michael Mahoney
> 781-812-8842 | mike.mahoney@gmail.com
>
> Michael Mahoney
> 781-812-8842 | mike.mahoney....@gmail.com
>
>
> On Thu, Jun 18, 2020 at 2:14 PM Manuel Spínola 
> wrote:
>
>> Thank you very much Rich.
>>
>> Manuel
>>
>> El jue., 18 jun. 2020 a las 12:11, Rich Shepard (<
>> rshep...@appl-ecosys.com>)
>> escribió:
>>
>> > On Thu, 18 Jun 2020, Manuel Spínola wrote:
>> >
>> > > I teach mainly to wildlife ecology students.
>> >
>> > Manuel,
>> >
>> > I'm a stream ecologist/fluvial geomorphologist but have run my sole
>> > environmental consulting practice for the past 27 years.
>> >
>> > > I was using several datasets from different sources for homeworks and
>> > > final projects, but some of the students were "sharing" the results of
>> > the
>> > > assignments so I decided to assign different datasets to each student
>> for
>> > > their homeworks. This means that I need several datasets for each
>> > > assignment, and the data need to be similar in the structure, for
>> > example,
>> > > logistic regression, the response variable needs to be binary, and so
>> on.
>> >
>> > I have fish and benthic macroinvertebate data and some terrestrial
>> animal
>> > data, but this might be a good resource for you:
>> > <https://ecologicaldata.org/find-data>.
>> >
>> > When the animal's population status or critical habitat is
>> controversial,
>> > as
>> > most tend to be, it can be difficult to get good data sets from the
>> > resource
>> > agencies.
>> >
>> > Let me know if I can help.
>> >
>> > Regards,
>> >
>> > Rich
>> >
>> > ___
>> > R-sig-ecology mailing list
>> > R-sig-ecology@r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>> >
>>
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr 
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Personal website: Lobito de río <
>> https://sites.google.com/site/lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Thank you very much Rich.

Manuel

El jue., 18 jun. 2020 a las 12:11, Rich Shepard ()
escribió:

> On Thu, 18 Jun 2020, Manuel Spínola wrote:
>
> > I teach mainly to wildlife ecology students.
>
> Manuel,
>
> I'm a stream ecologist/fluvial geomorphologist but have run my sole
> environmental consulting practice for the past 27 years.
>
> > I was using several datasets from different sources for homeworks and
> > final projects, but some of the students were "sharing" the results of
> the
> > assignments so I decided to assign different datasets to each student for
> > their homeworks. This means that I need several datasets for each
> > assignment, and the data need to be similar in the structure, for
> example,
> > logistic regression, the response variable needs to be binary, and so on.
>
> I have fish and benthic macroinvertebate data and some terrestrial animal
> data, but this might be a good resource for you:
> <https://ecologicaldata.org/find-data>.
>
> When the animal's population status or critical habitat is controversial,
> as
> most tend to be, it can be difficult to get good data sets from the
> resource
> agencies.
>
> Let me know if I can help.
>
> Regards,
>
> Rich
>
> ___________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Thank you very much Tom.

Manuel

El jue., 18 jun. 2020 a las 12:05, Philippi, Tom ()
escribió:

> Many ecological journals either encourage or require that the dataset
> behind a paper be submitted to a repository such as dryad, or included as
> an electronic appendix.  Even if your university does not have
> institutional subscription to all journals, some journals like Ecosphere
> are open-access, many journals allow authors to pay to make their papers
> open-access, and some journals with paywall papers allow free access to the
> abstract and the supplements including datasets or links to the datasets in
> repositories.  That has an advantage of letting you work from a topic or
> form of data for your teaching to find suitable datasets.  Also, those
> datasets tend to be cleaned and documented and close to ready for the
> analyses, as they were used in the analyses in the publications.
>
> The rdryad package from rOpenSci (on CRAN) has the ability to search
> dryad, but I suspect that search works better with ecological keywords than
> statistical ones.
>
> Tom
>
> -Original Message-
> From: R-sig-ecology  On Behalf Of
> Rich Shepard
> Sent: Thursday, June 18, 2020 10:38 AM
> To: r-sig-ecology@r-project.org
> Subject: [EXTERNAL] Re: [R-sig-eco] Ecological datasets for teaching
> statistics
>
> On Thu, 18 Jun 2020, Manuel Spínola wrote:
>
> > I teach statistics to students in ecology and environmental sciences
> > fields and I would like to know if you could point me in the right
> > direction of sources of ecological/environmental datasets within and
> > outside packages, especially for general/generalized linear models and
> > multivariate statistics.
>
> Manuel,
>
> Ecology, and it's applied focus Environmental science, are very broad.
> I've been working with these data for several decades so I need to ask what
> types of data you want.
>
> I don't know what's available from Costa Rican agencies but I do know that
> in the US you can get geochemical, biological, hydrologidal, and other data
> from the US Geological Survay, Environmental Protection Agency (if they've
> not removed them), Department of Agriculture's Forest Service and Natural
> Resources Conservation Service.
>
> You can also look at StreamNet run by the Pacific States Marine Fisheries
> Council, The Army Corps of Engineers for hydraulic, flow, and sediment
> transport data.
>
> That's a start.
>
> Rich
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Thank you very much Rich.

Yes, you are right, is a very broad spectrum.

I teach mainly to wildlife ecology students.

I was using several datasets from different sources for homeworks and
final projects, but some of the students were "sharing" the results of the
assignments so I decided to assign different datasets to each student for
their homeworks.  This means that I need several datasets for each
assignment, and the data need to be similar in the structure, for example,
logistic regression, the response variable needs to be binary, and so on.

Manuel



El jue., 18 jun. 2020 a las 11:41, Rich Shepard ()
escribió:

> On Thu, 18 Jun 2020, Manuel Spínola wrote:
>
> > I teach statistics to students in ecology and environmental sciences
> > fields and I would like to know if you could point me in the right
> > direction of sources of ecological/environmental datasets within and
> > outside packages, especially for general/generalized linear models and
> > multivariate statistics.
>
> Manuel,
>
> Ecology, and it's applied focus Environmental science, are very broad. I've
> been working with these data for several decades so I need to ask what
> types
> of data you want.
>
> I don't know what's available from Costa Rican agencies but I do know that
> in the US you can get geochemical, biological, hydrologidal, and other data
> from the US Geological Survay, Environmental Protection Agency (if they've
> not removed them), Department of Agriculture's Forest Service and Natural
> Resources Conservation Service.
>
> You can also look at StreamNet run by the Pacific States Marine Fisheries
> Council, The Army Corps of Engineers for hydraulic, flow, and sediment
> transport data.
>
> That's a start.
>
> Rich
>
> _______
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Thank you very much Jeff.

I will take a look on that.

Manuel

El jue., 18 jun. 2020 a las 11:31, Holland, Jeffrey D ()
escribió:

> Dear Manuel,
>  Have a look at the Dryad data repository, datadryad.org.  You can
> search around for many ecological data sets.  I have used this a lot for
> similar classes.  You can also read the associated paper for the data sets
> and give students as much background as you wish.
> Sincerely,
> Jeff
>
>
> /*-
> Jeffrey D. Holland, Professor
> jdhol...@purdue.edu
> Dept. of Entomology, Purdue University765 /
> 494-7739
> www.entm.purdue.edu/landscapeecology
> Fellow of the Indiana Academy of Science
> http://www.bugsmapsandmath.com
>
> ---*/
>
> ________
> From: R-sig-ecology  on behalf of
> Manuel Spínola 
> Sent: Thursday, June 18, 2020 1:20 PM
> To: r-sig-ecology@r-project.org 
> Subject: [R-sig-eco] Ecological datasets for teaching statistics
>
> Dear list members,
>
> I teach statistics to students in ecology and environmental sciences fields
> and I would like to know if you could point me in the right direction of
> sources of ecological/environmental datasets within and outside packages,
> especially for general/generalized linear models and multivariate
> statistics.
>
>
>  Manuel Spínola
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Ecological datasets for teaching statistics

2020-06-18 Thread Manuel Spínola
Dear list members,

I teach statistics to students in ecology and environmental sciences fields
and I would like to know if you could point me in the right direction of
sources of ecological/environmental datasets within and outside packages,
especially for general/generalized linear models and multivariate
statistics.


 Manuel Spínola


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Mixed model in R

2019-05-21 Thread Manuel Spínola
Dear list members,

Sorry for cross-posting.

I measured an index on 12 points within each of 3 cover types on 4 seasons.

But the index was measured several times within hours, on different days
and different months.

I want to assess changes in the index among cover types and seasons.

Is the following model parameterization appropriate in the lme4 package:

mod_adi_01 <- lmer(ADI ~ Season*CoverType + (1 | Point) + (1 | Month) + (1
| Day) + (1 | Hour), data = df_01, REML = FALSE)

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] UK.AdvancingInRForEcologists.Dec4-8

2017-10-18 Thread Manuel Spínola
PHYL
> 28th Jan – Feb 2nd 2018, SCENE, Scotland, Dr. Emmanuel Paradis
> https://www.prstatistics.com/course/introduction-to-phylogen
> etic-analysis-with-r-phyg-phyl02/
>
> 11. MOVEMENT ECOLOGY #MOVE
> 19th – 23rd February 2018, Wales, Dr Luca Borger, Dr Ronny Wilson, Dr
> Jonathan Potts
> https://www.prstatistics.com/course/movement-ecology-move01/
>
> 12. GEOMETRIC MORPHOMETRICS USING R #GMMR
> 19th – 23rd February 2018, Wales, Prof. Dean Adams, Prof. Michael Collyer,
> Dr. Antigoni Kaliontzopoulou
> http://www.prstatistics.com/course/geometric-morphometrics-using-r-gmmr01/
>
> 13. FUNCTIONAL ECOLOGY FROM ORGANISM TO ECOSYSTEM: THEORY AND
> COMPUTATION #FEER
> 5th – 9th March 2018, SCENE, Scotland, Dr. Francesco de Bello, Dr. Lars
> Götzenberger, Dr. Carlos Carmona
> http://www.prstatistics.com/course/functional-ecology-from-
> organism-to-ecosystem-theory-and-computation-feer01/
>
> 14. SPATIAL PRIORITIZATION USING MARXAN #MRXN
> 5th - 9th March 2018, Wales, Jennifer McGowan
> https://www.prstatistics.com/course/introduction-to-marxan-mrxn01/
>
> 15. ECOLOGICAL NICHE MODELLING USING R #ENMR
> 12th - 16th March 2018, SCENE, Scotland, Dr. Neftali Sillero
> http://www.prstatistics.com/course/ecological-niche-modellin
> g-using-r-enmr02/
>
> 16. BEHAVIOURAL DATA ANALYSIS USING MAXIMUM LIKLIHOOD IN R #BDML
> 19th – 23rd March 2018, Scotland, Dr William Hoppitt
> COMING SOON  www.PSstatistics.com
>
> 17. NETWORK ANAYLSIS FOR ECOLOGISTS USING R #NTWA
> 9th – 13th April 2018, SCENE, Scotland, Dr. Marco Scotti
> https://www.prstatistics.com/course/network-analysis-ecologists-ntwa02/
>
> 18. INTRODUCTION TO STATISTICAL MODELLING FOR PSYCHOLOGISTS USING R
> #IPSY
> 16th – 20th April 2018, SCENE, Scotland, Dr. Dale Barr, Dr Luc Bussierre
> COMING SOON  www.PSstatistics.com
>
> 19. MULTIVARIATE ANALYSIS OF ECOLOGICAL COMMUNITIES USING THE VEGAN
> PACKAGE #VGNR
> 23rd – 27th April 2018, SCENE, Scotland, Dr. Peter Solymos, Dr. Guillaume
> Blanchet
> https://www.prstatistics.com/course/multivariate-analysis-of
> -ecological-communities-in-r-with-the-vegan-package-vgnr01/
>
> 20. QUANTITATIVE GEOGRAPHIC ECOLOGY: MODELING GENOMES, NICHES, AND
> COMMUNITIES #QGER
> 30th April – 4th May 2018, SCENE, Scotland, Dr. Dan Warren, Dr. Matt
> Fitzpatrick
> COMING SOON  www.PRstatistics.com
>
> 21. INTRODUCTION TO MIXED MODELS FOR ECOLOGISTS #IMMR
> 14th - 18th May 2018, CANADA (QUEBEC) STILL to be confirmed, Prof Subhash
> Lele, Dr. Guillaume Blanchet
>
> 22. STABLE ISOTOPE MIXING MODELS USING SIAR, SIBER AND MIXSIAR #SIMM
> 28th May – 1st June 2018, CANADA (QUEBEC) STILL to be confirmed Dr. Andrew
> Parnell, Dr. Andrew Jackson
>
> 23. SOCIAL NETWORK ANALYSIS FOR BEHAVIOURAL SCIENTISTS USING R #SNAR
> 2nd - 5th12th July 2018, Prof James Curley
> COMING SOON  www.PSstatistics.com
>
> 24. MODEL BASE MULTIVARIATE ANALYSIS OF ABUNDANCE DATA USING R #MBMV
> 8th – 12th July 2018, Prof David Warton
> https://www.prstatistics.com/course/model-base-multivariate-
> analysis-of-abundance-data-using-r-mbmv02/
>
> 25. EUKARYOTIC METABARCODING
> 23rd – 27th July 2018, Wales, Dr. Owen Wangensteen
> http://www.prinformatics.com/course/eukaryotic-metabarcoding-eukb01/
>
> 26. ADVANCES IN MULTIVARIATE ANALYSIS OF SPATIAL ECOLOGICAL DATA USING
> R #MVSP
> Prof. Pierre Legendre, Dr. Olivier Gauthier - Date and location to be
> confirmed
>
>
> --
> Oliver Hooker PhD.
> PR statistics
>
> 2017 publications -
>
> Ecosystem size predicts eco-morphological variability in post-glacial
> diversification. Ecology and Evolution. In press.
>
> The physiological costs of prey switching reinforce foraging
> specialization. Journal of animal ecology.
>
> prstatistics.com
> facebook.com/prstatistics/
> twitter.com/PRstatistics
> groups.google.com/d/forum/pr-statistics-post-course-forum
> prstatistics.com/organiser/oliver-hooker/
>
> 6 Hope Park Crescent
> Edinburgh
> EH8 9NA
>
> +44 (0) 7966500340
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology




-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Re: [R-sig-eco] UK.AdvancingInRForEcologists.Dec4-8

2017-10-18 Thread Manuel Spínola
w.prstatistics.com/course/introduction-to-bayesian-
> hierarchical-modelling-using-r-ibhm02/
>
> 10. PHYLOGENETIC DATA ANALYSIS USING R #PHYL
> 28th Jan – Feb 2nd 2018, SCENE, Scotland, Dr. Emmanuel Paradis
> https://www.prstatistics.com/course/introduction-to-phylogen
> etic-analysis-with-r-phyg-phyl02/
>
> 11. MOVEMENT ECOLOGY #MOVE
> 19th – 23rd February 2018, Wales, Dr Luca Borger, Dr Ronny Wilson, Dr
> Jonathan Potts
> https://www.prstatistics.com/course/movement-ecology-move01/
>
> 12. GEOMETRIC MORPHOMETRICS USING R #GMMR
> 19th – 23rd February 2018, Wales, Prof. Dean Adams, Prof. Michael Collyer,
> Dr. Antigoni Kaliontzopoulou
> http://www.prstatistics.com/course/geometric-morphometrics-using-r-gmmr01/
>
> 13. FUNCTIONAL ECOLOGY FROM ORGANISM TO ECOSYSTEM: THEORY AND
> COMPUTATION #FEER
> 5th – 9th March 2018, SCENE, Scotland, Dr. Francesco de Bello, Dr. Lars
> Götzenberger, Dr. Carlos Carmona
> http://www.prstatistics.com/course/functional-ecology-from-
> organism-to-ecosystem-theory-and-computation-feer01/
>
> 14. SPATIAL PRIORITIZATION USING MARXAN #MRXN
> 5th - 9th March 2018, Wales, Jennifer McGowan
> https://www.prstatistics.com/course/introduction-to-marxan-mrxn01/
>
> 15. ECOLOGICAL NICHE MODELLING USING R #ENMR
> 12th - 16th March 2018, SCENE, Scotland, Dr. Neftali Sillero
> http://www.prstatistics.com/course/ecological-niche-modellin
> g-using-r-enmr02/
>
> 16. BEHAVIOURAL DATA ANALYSIS USING MAXIMUM LIKLIHOOD IN R #BDML
> 19th – 23rd March 2018, Scotland, Dr William Hoppitt
> COMING SOON  www.PSstatistics.com
>
> 17. NETWORK ANAYLSIS FOR ECOLOGISTS USING R #NTWA
> 9th – 13th April 2018, SCENE, Scotland, Dr. Marco Scotti
> https://www.prstatistics.com/course/network-analysis-ecologists-ntwa02/
>
> 18. INTRODUCTION TO STATISTICAL MODELLING FOR PSYCHOLOGISTS USING R
> #IPSY
> 16th – 20th April 2018, SCENE, Scotland, Dr. Dale Barr, Dr Luc Bussierre
> COMING SOON  www.PSstatistics.com
>
> 19. MULTIVARIATE ANALYSIS OF ECOLOGICAL COMMUNITIES USING THE VEGAN
> PACKAGE #VGNR
> 23rd – 27th April 2018, SCENE, Scotland, Dr. Peter Solymos, Dr. Guillaume
> Blanchet
> https://www.prstatistics.com/course/multivariate-analysis-of
> -ecological-communities-in-r-with-the-vegan-package-vgnr01/
>
> 20. QUANTITATIVE GEOGRAPHIC ECOLOGY: MODELING GENOMES, NICHES, AND
> COMMUNITIES #QGER
> 30th April – 4th May 2018, SCENE, Scotland, Dr. Dan Warren, Dr. Matt
> Fitzpatrick
> COMING SOON  www.PRstatistics.com
>
> 21. INTRODUCTION TO MIXED MODELS FOR ECOLOGISTS #IMMR
> 14th - 18th May 2018, CANADA (QUEBEC) STILL to be confirmed, Prof Subhash
> Lele, Dr. Guillaume Blanchet
>
> 22. STABLE ISOTOPE MIXING MODELS USING SIAR, SIBER AND MIXSIAR #SIMM
> 28th May – 1st June 2018, CANADA (QUEBEC) STILL to be confirmed Dr. Andrew
> Parnell, Dr. Andrew Jackson
>
> 23. SOCIAL NETWORK ANALYSIS FOR BEHAVIOURAL SCIENTISTS USING R #SNAR
> 2nd - 5th12th July 2018, Prof James Curley
> COMING SOON  www.PSstatistics.com
>
> 24. MODEL BASE MULTIVARIATE ANALYSIS OF ABUNDANCE DATA USING R #MBMV
> 8th – 12th July 2018, Prof David Warton
> https://www.prstatistics.com/course/model-base-multivariate-
> analysis-of-abundance-data-using-r-mbmv02/
>
> 25. EUKARYOTIC METABARCODING
> 23rd – 27th July 2018, Wales, Dr. Owen Wangensteen
> http://www.prinformatics.com/course/eukaryotic-metabarcoding-eukb01/
>
> 26. ADVANCES IN MULTIVARIATE ANALYSIS OF SPATIAL ECOLOGICAL DATA USING
> R #MVSP
> Prof. Pierre Legendre, Dr. Olivier Gauthier - Date and location to be
> confirmed
>
>
> --
> Oliver Hooker PhD.
> PR statistics
>
> 2017 publications -
>
> Ecosystem size predicts eco-morphological variability in post-glacial
> diversification. Ecology and Evolution. In press.
>
> The physiological costs of prey switching reinforce foraging
> specialization. Journal of animal ecology.
>
> prstatistics.com
> facebook.com/prstatistics/
> twitter.com/PRstatistics
> groups.google.com/d/forum/pr-statistics-post-course-forum
> prstatistics.com/organiser/oliver-hooker/
>
> 6 Hope Park Crescent
> Edinburgh
> EH8 9NA
>
> +44 (0) 7966500340
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology




-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Re: [R-sig-eco] How to include math symbols in a data frame

2017-10-09 Thread Manuel Spínola
Thank you Yaïr.

Sorry about that.

Looking in an answer from stackoverflow for another type of problem, I
found this solution:

column1 <- c("a", "b", "c")
column2 <- c("\u2264 0.3", 0.5, 0.8)
column3 <- c("\u2264 0.5" , 0.6, 0.9)

table <- data.frame(column1, column2, column3)

kable(table)

2017-10-09 9:55 GMT-06:00 Levy, Yaïr :

> Dear Manuel,
>
>
> How about:
>
> "
>
> column1 <- c("a", "b", "c")
> column2 <- paste("<= ", c(0.3, 0.5, 0.8))
> column3 <- paste("<= ", c(0.5, 0.6, 0.9))
>
> table <- data.frame(column1, column2, column3)
>
> table
>
>
> "
>
>
>
> Watch out not to mix English with Spanish while scripting fast.
>
>
> Pura Vida!
>
>
> Yaïr Levy
>
>
>
>
>
>
>
> -Oorspronkelijk bericht-
> Van: R-sig-ecology [mailto:r-sig-ecology-boun...@r-project.org] Namens
> Manuel Spínola
> Verzonden: maandag 9 oktober 2017 17:48
> Aan: r-sig-ecology@r-project.org
> Onderwerp: [R-sig-eco] How to include math symbols in a data frame
>
> Dear list members,
>
> I am trying to make a table with math symbols, specifically, less than or
> equal to symbol:
>
> column1 <- c("a", "b", "c")
> column2 <- c("less than or equal to" 0.3, 0.5, 0.8)
> column3 <- c("less than or equal to" 0.5, 0.6, 0.9)
>
> table <- data.frame(columna1, columna2, columna3)
>
> kable(table)
>
> How can I include the math symbol in the table?
>
> Manuel
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA mspin...@una.cr
>  mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <https://sites.google.com/
> site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

[R-sig-eco] How to include math symbols in a data frame

2017-10-09 Thread Manuel Spínola
Dear list members,

I am trying to make a table with math symbols, specifically, less than or
equal to symbol:

column1 <- c("a", "b", "c")
column2 <- c("less than or equal to" 0.3, 0.5, 0.8)
column3 <- c("less than or equal to" 0.5, 0.6, 0.9)

table <- data.frame(columna1, columna2, columna3)

kable(table)

How can I include the math symbol in the table?

Manuel
-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Re: [R-sig-eco] mvpart alternatives and machine learning multivariate analysis

2017-06-24 Thread Manuel Spínola
Thank you very much Ralf.

I am looking for alternatives to the classic CCA community analysis, and I
was thinking into machine learning techniques.

Manuel

2017-06-24 10:10 GMT-06:00 Ralf Schäfer :

> Indeed! To expand on this: if you need a tutorial for mvabund, we once
> analysed some categorical multivariate data and provided a tutorial:
> http://dx.doi.org/10.1007/s10646-015-1421-0
> Paper and tutorial are freely available on researchgate
>
> There are also many other methods, but to point you to some, it would be
> good if you were more specific than „community- environment relationships“.
>
> Best regards
> Ralf
>
>
> Am 24.06.2017 um 18:02 schrieb Torsten Hauffe :
>
> As far as I remember, on Windows you will need to download and install the
> Rtools first (https://cran.r-project.org/bin/windows/Rtools/) because
> some parts of mvpart need to be compiled.
>
> You can analyse multiple species-environment relationships with the
> mvabund package. This is not fancy machine-learning but solid likelihood
> statistic.
>
> HTH,
> Torsten
>
> On 24 June 2017 at 11:57, Ralf Schäfer  wrote:
>
>> Manuel,
>>
>> I just checked, it is currently still compatible. So you can download
>> from the archive and install from source - at least on Linux and OS X, nut
>> sure about Windows.
>> See Session information below:
>>
>> > R version 3.4.0 (2017-04-21)
>> > Platform: x86_64-apple-darwin15.6.0 (64-bit)
>> > Running under: macOS Sierra 10.12.5
>> >
>> > Matrix products: default
>> > BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/
>> libRblas.0.dylib
>> > LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/
>> libRlapack.dylib
>> >
>> > locale:
>> > [1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8
>> >
>> > attached base packages:
>> > [1] stats graphics  grDevices utils datasets  methods   base
>> >
>> > other attached packages:
>> > [1] mvpart_1.6-2
>> >
>> > loaded via a namespace (and not attached):
>> > [1] compiler_3.4.0
>>
>>
>> However, there are certainly other packages that can partition
>> multivariate ecological data, though I am not aware of other packages for
>> use with multivariate regression trees.
>>
>> Regards
>> Ralf
>>
>>
>>
>> > Am 24.06.2017 um 17:47 schrieb Manuel Spínola :
>> >
>> > Thank you Ralf,
>> >
>> > But I guess is not going to be newer versions and could be incompatible
>> with newer version of R, so at some moment there will be no accessibility
>> to the package.
>> >
>> > Manuel
>> >
>> > 2017-06-24 5:25 GMT-06:00 Ralf Schäfer > <mailto:sena...@ecotoxicology.de>>:
>> > Dear Manuel
>> >
>> > despite it has been removed, it should still work.
>> > At least I used it last year - just install the version from the
>> archive manually:
>> > https://cran.r-project.org/src/contrib/Archive/mvpart/ <
>> https://cran.r-project.org/src/contrib/Archive/mvpart/>
>> >
>> > Best regards
>> > Ralf
>> >
>> >
>> >> Date: Fri, 23 Jun 2017 13:59:13 -0600
>> >> From: Manuel Sp?nola > mspinol...@gmail.com>>
>> >> To: "r-sig-ecology@r-project.org <mailto:r-sig-ecology@r-project.org>"
>> mailto:r-sig-ecology@r-project.org>>
>> >> Subject: [R-sig-eco] mvpart alternatives and machine learning
>> >>  multivariateanalysis
>> >> Message-ID:
>> >>  > gmail.com <mailto:CABkCotRiCwJjsh=_hsONMsh+OE52rC7L6E3Q4ssOUM=6w3DXTw@
>> mail.gmail.com>>
>> >> Content-Type: text/plain; charset="UTF-8"
>> >>
>> >> Dear list members,
>> >>
>> >> As mvpart has been removed form the CRAN repository, Is there any r
>> package
>> >> that do similar analysis (multivariate partitioning)?
>> >>
>> >> Also, is there any other machine learning technique to do multivariate
>> >> analysis as done in ecology to asses multiple species-environment
>> >> relationships?
>> >>
>> >> Thank you very much in advance,
>> >>
>> >> Manuel
>> >>
>> >> --
>> >> *Manuel Sp?nola, Ph.D.*
>> >> Instituto Internacional en Conservaci?n y Manejo de Vida Silvestre
>> >> Universidad Nacional
>> >> Apartado 

Re: [R-sig-eco] mvpart alternatives and machine learning multivariate analysis

2017-06-24 Thread Manuel Spínola
Thank you very much Torsten.

Manuel

2017-06-24 10:02 GMT-06:00 Torsten Hauffe :

> As far as I remember, on Windows you will need to download and install the
> Rtools first (https://cran.r-project.org/bin/windows/Rtools/) because
> some parts of mvpart need to be compiled.
>
> You can analyse multiple species-environment relationships with the
> mvabund package. This is not fancy machine-learning but solid likelihood
> statistic.
>
> HTH,
> Torsten
>
> On 24 June 2017 at 11:57, Ralf Schäfer  wrote:
>
>> Manuel,
>>
>> I just checked, it is currently still compatible. So you can download
>> from the archive and install from source - at least on Linux and OS X, nut
>> sure about Windows.
>> See Session information below:
>>
>> > R version 3.4.0 (2017-04-21)
>> > Platform: x86_64-apple-darwin15.6.0 (64-bit)
>> > Running under: macOS Sierra 10.12.5
>> >
>> > Matrix products: default
>> > BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/
>> libRblas.0.dylib
>> > LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/
>> libRlapack.dylib
>> >
>> > locale:
>> > [1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8
>> >
>> > attached base packages:
>> > [1] stats graphics  grDevices utils datasets  methods   base
>> >
>> > other attached packages:
>> > [1] mvpart_1.6-2
>> >
>> > loaded via a namespace (and not attached):
>> > [1] compiler_3.4.0
>>
>>
>> However, there are certainly other packages that can partition
>> multivariate ecological data, though I am not aware of other packages for
>> use with multivariate regression trees.
>>
>> Regards
>> Ralf
>>
>>
>>
>> > Am 24.06.2017 um 17:47 schrieb Manuel Spínola :
>> >
>> > Thank you Ralf,
>> >
>> > But I guess is not going to be newer versions and could be incompatible
>> with newer version of R, so at some moment there will be no accessibility
>> to the package.
>> >
>> > Manuel
>> >
>> > 2017-06-24 5:25 GMT-06:00 Ralf Schäfer > <mailto:sena...@ecotoxicology.de>>:
>> > Dear Manuel
>> >
>> > despite it has been removed, it should still work.
>> > At least I used it last year - just install the version from the
>> archive manually:
>> > https://cran.r-project.org/src/contrib/Archive/mvpart/ <
>> https://cran.r-project.org/src/contrib/Archive/mvpart/>
>> >
>> > Best regards
>> > Ralf
>> >
>> >
>> >> Date: Fri, 23 Jun 2017 13:59:13 -0600
>> >> From: Manuel Sp?nola > mspinol...@gmail.com>>
>> >> To: "r-sig-ecology@r-project.org <mailto:r-sig-ecology@r-project.org>"
>> mailto:r-sig-ecology@r-project.org>>
>> >> Subject: [R-sig-eco] mvpart alternatives and machine learning
>> >>  multivariateanalysis
>> >> Message-ID:
>> >>  > gmail.com <mailto:CABkCotRiCwJjsh=_hsONMsh+OE52rC7L6E3Q4ssOUM=6w3DXTw@
>> mail.gmail.com>>
>> >> Content-Type: text/plain; charset="UTF-8"
>> >>
>> >> Dear list members,
>> >>
>> >> As mvpart has been removed form the CRAN repository, Is there any r
>> package
>> >> that do similar analysis (multivariate partitioning)?
>> >>
>> >> Also, is there any other machine learning technique to do multivariate
>> >> analysis as done in ecology to asses multiple species-environment
>> >> relationships?
>> >>
>> >> Thank you very much in advance,
>> >>
>> >> Manuel
>> >>
>> >> --
>> >> *Manuel Sp?nola, Ph.D.*
>> >> Instituto Internacional en Conservaci?n y Manejo de Vida Silvestre
>> >> Universidad Nacional
>> >> Apartado 1350-3000
>> >> Heredia
>> >> COSTA RICA
>> >> mspin...@una.cr <mailto:mspin...@una.cr> > mspin...@una.ac.cr>>
>> >> mspinol...@gmail.com <mailto:mspinol...@gmail.com>
>> >> Tel?fono: (506) 8706 - 4662
>> >> Personal website: Lobito de r?o <https://sites.google.com/site
>> /lobitoderio/ <https://sites.google.com/site/lobitoderio/>>
>> >> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/ <
>> http://www.icomvis.una.ac.cr/>>
>> >
>> >
>> >
>&

Re: [R-sig-eco] mvpart alternatives and machine learning multivariate analysis

2017-06-24 Thread Manuel Spínola
Thank you Ralf,

But I guess is not going to be newer versions and could be incompatible
with newer version of R, so at some moment there will be no accessibility
to the package.

Manuel

2017-06-24 5:25 GMT-06:00 Ralf Schäfer :

> Dear Manuel
>
> despite it has been removed, it should still work.
> At least I used it last year - just install the version from the archive
> manually:
> https://cran.r-project.org/src/contrib/Archive/mvpart/
>
> Best regards
> Ralf
>
>
> Date: Fri, 23 Jun 2017 13:59:13 -0600
> From: Manuel Sp?nola 
> To: "r-sig-ecology@r-project.org" 
> Subject: [R-sig-eco] mvpart alternatives and machine learning
> multivariate analysis
> Message-ID:
> 
> Content-Type: text/plain; charset="UTF-8"
>
> Dear list members,
>
> As mvpart has been removed form the CRAN repository, Is there any r package
> that do similar analysis (multivariate partitioning)?
>
> Also, is there any other machine learning technique to do multivariate
> analysis as done in ecology to asses multiple species-environment
> relationships?
>
> Thank you very much in advance,
>
> Manuel
>
> --
> *Manuel Sp?nola, Ph.D.*
> Instituto Internacional en Conservaci?n y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Tel?fono: (506) 8706 - 4662
> Personal website: Lobito de r?o <https://sites.google.com/
> site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

[R-sig-eco] mvpart alternatives and machine learning multivariate analysis

2017-06-23 Thread Manuel Spínola
Dear list members,

As mvpart has been removed form the CRAN repository, Is there any r package
that do similar analysis (multivariate partitioning)?

Also, is there any other machine learning technique to do multivariate
analysis as done in ecology to asses multiple species-environment
relationships?

Thank you very much in advance,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

[R-sig-eco] How to compare 2 independent estimates in R

2017-05-26 Thread Manuel Spínola
Dear list members,

How can I compare 2 independent estimates in R?

For example, I want to compare a mean that I obtained in my study with a
mean that was obtained in another study (2 independent studies).

My estimate: 2.3, EE = 0.73

The other estimate: 3.4, EE = 0.97

I want to obtain the effect size (the difference between estimates) with
the 95% confidence limits.

Is there any package that allow me to do that?

Best,

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

[R-sig-eco] Machine learning in R for ecology

2017-05-21 Thread Manuel Spínola
Dear list members,

In recent years I have been an increase on the use of machine learning in R
in several scientific disciplines, but I would like to know if anyone can
share any recent development on the use of machine learning in R for
ecology and environmental science.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

[R-sig-eco] Repeated mesaures mixed model in R

2016-11-01 Thread Manuel Spínola
Dear list members,

I am fitting a repeated measures mixed model in R.

I have a response variable (continuous) with 4 treatments.  Each treatment
has 4 plots, and each plot was divided in 4 subplots.  The variable was
measured 5 times (occasions).

My attempt is:

mod <- lmer(response variable ~ occasion * treatment + (occasion |
plot/subplot)

Is the model parameterization correct?

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Re: [R-sig-eco] Package to analyse population time series (trend analysis)

2016-10-19 Thread Manuel Spínola
Thank you very much to both.

I analyzing counts of flying Ara macaw over a bridge.  I could have the
data for 2 more sites, but essentially is one site.  There are monthly
counts, but I am planning to use the maximum count for each year.  These
are not census data, only counts with imperfect detection.  My goal is to
do a trend analysis for those counts, of course I know the limitation of
the data and I know that  the biological interpretation of the results will
be challenging.

Best,

Manuel



2016-10-19 12:05 GMT-06:00 Philippi, Tom :

> Manuel--
> The proper package depends entirely on what your data are: how many sites
> you collect counts for, whether those sites are a probability sample over
> an area or the only locations you are making inferences about (e.g., census
> counts), whether those counts have Poisson error, overdispersion (e.g.,
> aggregation) or zero-inflation (e.g., extra 0s from bad weather or bad
> sites), imperfect detection, marked individuals, whether you expect a
> linear or only monotonic trend, whether you have covariates that vary by
> year (e.g., annual precipitation or winter NINO3.4), or or other aspects I
> haven't yet dealt with.
>
> A bit more information about what you have in terms of data, and about the
> questions you are interested within the broad definition of "trend" might
> get you informed answers.
>
> Tom 2
>
>
>
> On Wed, Oct 19, 2016 at 5:47 AM, Manuel Spínola 
> wrote:
>
>> Dear list members,
>>
>> What is the appropriate package to analyze population time series (trend
>> analysis) when you have one count per year.
>>
>> Best,
>>
>> Manuel
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr 
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Personal website: Lobito de río <https://sites.google.com/site
>> /lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>>     [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

[R-sig-eco] Package to analyse population time series (trend analysis)

2016-10-19 Thread Manuel Spínola
Dear list members,

What is the appropriate package to analyze population time series (trend
analysis) when you have one count per year.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Re: [R-sig-eco] Question on unexpected regression results

2014-07-30 Thread Manuel Spínola
Dear Bruce,

Besides any other problems I can see that you consider FA as a factor and
that could be a problem with your data set.

Manuel


2014-07-30 7:10 GMT-06:00 Bruce Miller :

> Hi all,
>
> Sorry this is a bit long, but the explanation of what I want to do needs
> to be clear to avoid  issues such as this quote..."It is impossible to
> speak in such a way that you cannot be misunderstood." Karl Popper.
>
> I am running linear regression models, but I am getting expected results.
> I wonder what else I might try to derive an estimated value of bat
> echolocation parameters based on forearm measurements.  It is known that
> the size of the bat is negatively related to the characteristic
> frequency (Fc) of their echolocation calls (decades of my field work) .
> So in general larger guys have lower frequency calls and smaller guys
> have higher frequency calls.
>
> I have run the regressions based on the FA (valid forearm measurements)
> and the known and valid Fc ranges for a dozen species or so and using
> the lm models to "predict" Fc values for a few species that have FA
> values but have not yet been recorded.  Hence there are no valid
> echolocation call parameters.  R Code used is below discussion.
>
> I have valid ranges for the known species FA (forearm measurements) and
> Fc(minimum) and Fc (maximum).  So I  do two separate runs with the data
> using the lm model one with FA~Fcmin and one FA~Fcmax.
>
> The goal is to provide the predicted (estimated) values for the species
> with known FA values but w/o verified Fc value ranges.
>
> My concern is that the predicted values returned are much lower than the
> true values for the verified species.  Therefore I am not confident the
> predicted values for those w/o verified Fc ranges are useful.
>
> One very helpful person looked at one simple data set I sent and showed
> that the statistical differences between the true values and predicted
> were not significant.
>
> However Krebs' admonishment to students eons ago "Do not confuse
> statistical significance with ecological significance" is true here.
> The values of the predicted ranges are far lower than reality so the few
> species that do not have field recorded Fc values  are suspect.  These
> differences in predicted values from a true range will will make a
> difference for potentially IDing the unknown calls.  A difference of
> 10kHz Fc generally suggests a different species, albeit some are much
> closer and may only have a 5 kHz difference.
>
> I am looking at acoustic data sets of calls from South America and there
> are  many "sonospecies."
> These are clearly separate species based on echolocation call parameters
> that have yet had "faces & voices" matched.  We know that call
> parameters are diagnostic for families and genera even when the species
> is unknown.  It is then the Fc values that assist in identifying the
> species within a cluster of calls from the same genus.
>
> Sample of R code used:
>
> Bats <- dget('C:/=Bat data working/Acoustic
> Parameters/_Working/=Vespertilionidae/Bats.robj')
>
> model.lm <- lm(formula=Fc ~ as.factor(FA),data=Bats,na.action=na.omit)
>  > Anova(model.lm,type='II') Error in solve.default(L %*% V %*% t(L)) :
> system is computationally singular: reciprocal condition number = 0
>  > summary(model.lm)
>
> Call:
> lm(formula = Fc ~ as.factor(FA), data = Bats, na.action = na.omit)
>
> Residuals:
> ALL 5 residuals are 0: no residual degrees of freedom!
>
> Coefficients:
>Estimate Std. Error t value Pr(>|t|)
> (Intercept)   53.3 NA  NA   NA
> as.factor(FA)34.4 -4.6 NA  NA   NA
> as.factor(FA)35.4  2.3 NA  NA   NA
> as.factor(FA)35.5  9.0 NA  NA   NA
> as.factor(FA)40.5 -7.3 NA  NA   NA
>
> Residual standard error: NaN on 0 degrees of freedom
>(2 observations deleted due to missingness)
> Multiple R-squared: 1,Adjusted R-squared:   NaN
> F-statistic:   NaN on 4 and 0 DF,  p-value: NA
>
>  > tmp<-predict(model.lm)
>  > Bats[names(tmp),"predicted"]<-tmp
>  > rm('tmp')
>  > rm('model.lm')
>  >
>
> >model.lm  <- lm(formula= Fc~ FA,data=Bats,na.action=na.omit)
>
> >Anova(model.lm,type='II')
>
> >summary(model.lm)
>
> >tmp<-predict(model.lm,Bats)
>
> >Bats[names(tmp),"Predicted.Fc"]<-tmp
>
> >rm('tmp')
>
> >rm('model.lm')
>
> With the results it can be seen that the predicted Fc values on right
> are not close to the true Fc values on left and then make me hesitant to
> accept the 2 with NA predicted values. FYI Species are simple 6 letter
> coded for genus and species.
> Species FA  Fcmin   Fcmax   FcMinpredic FcMaxpredic
> Myoalb  35.345.748.751.73   55.26
> Myoata  37  NA  NA  49.52   52.59
> Myokea  33.757.861.353.80   57.77
> Myonig  34.551.655.752.77   56.52
> Myooxy  40.545.747.644.98   47.09
> Myorip  36  53.357.550.82   54.16
> Myo

Re: [R-sig-eco] report out by t.test

2014-03-24 Thread Manuel Spínola
May be an approach on parameter estimation (as effect size) is most
interesting than a P value.

Best,

Manuel


2014-03-24 8:39 GMT-06:00 Zoltan Botta-Dukat <
botta-dukat.zol...@okologia.mta.hu>:

> Dear All,
>
> Jari probably refer to that Mann-Whitney test suppose same shape of the
> distributions (their positions may differ if H0 is false).
>
> Best wishes
> Zoltan
>
>
> 2014.03.24. 12:42 keltezéssel, Jari Oksanen írta:
>
>  Except that t-test does not assume that *observations* are normally
>> distributed, nor that variances are equal.
>>
>> Avoid non-parametric tests: they assume too much of data properties.
>>
>> For var.equal assumption in t.test, see ?t.test.
>>
>> Cheers, Jari Oksanen
>> 
>> From: r-sig-ecology-boun...@r-project.org [r-sig-ecology-bounces@r-
>> project.org] on behalf of Richard Boyce [boy...@nku.edu]
>> Sent: 24 March 2014 13:23
>> To: r-sig-ecology@r-project.org
>> Subject: Re: [R-sig-eco] report out by t.test
>>
>> Mike,
>>
>> There is no way that your data meet the assumptions of a t-test (normal
>> distributions, equal variance). A nonparametric Mann-Whitney (aka Wilcoxon)
>> test is much better suited to your data.
>>
>> Here's what I got when I ran it:
>>
>> Q<-c(13,0,10,2,0,0,1,0,0,1,5)
>> WD<-c(0,0,1,0,0,0,0,0,0,0,1)
>> wilcox.test(Q,WD)
>>
>> Wilcoxon rank sum test with continuity correction
>>
>> data:  Q and WD
>> W = 86.5, p-value = 0.05119
>> alternative hypothesis: true location shift is not equal to 0
>>
>> Warning message:
>> In wilcox.test.default(Q, WD) : cannot compute exact p-value with ties
>>
>> This has a p-value quite close to 0.05, giving some evidence that there's
>> a difference between your groups. Note that this you have different null
>> and alternative hypothesis: groups are the same vs. groups are different.
>>
>> Rick Boyce
>>
>> On Mar 24, 2014, at 7:00 AM, r-sig-ecology-requ...@r-project.org> r-sig-ecology-requ...@r-project.org> wrote:
>>
>> Message: 1
>> Date: Sun, 23 Mar 2014 14:21:41 -0700
>> From: Michael Marsh mailto:sw...@blarg.net>>
>> To: r-sig-ecology@r-project.org<mailto:r-sig-ecology@r-project.org>
>> Subject: [R-sig-eco] report out by t.test
>> Message-ID: <532f5065.7030...@blarg.net<mailto:532f5065.7030...@blarg.net
>> >>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> I test differences between frequency of hits of exotic annual forbs in
>> plots on  two sites, Q and WD.
>>
>> Q<-c(13,0,10,2,0,0,1,0,0,1,5)
>> WD<-c(0,0,1,0,0,0,0,0,0,0,1)
>> t.test(Q,WD)
>>
>>  Welch Two Sample t-test
>>
>> data:  Q and WD
>> t = 1.9807, df = 10.158, p-value = 0.07533
>> alternative hypothesis: true difference in means is not equal to 0
>> 95 percent confidence interval:
>>   -0.3342006  5.7887460
>> sample estimates:
>> mean of x mean of y
>> 2.9090909 0.1818182
>>
>> The p-value is greater than 0.05, thus does not reach the 95% confidence
>> level, yet the difference in means is reported as not equal to 0.
>> Am I encountering a one-sided versus two sided comparison that I don't
>> understand, or is ther another explanation?
>>
>> Mike Marsh
>>
>>
>>
>>
>> 
>> Richard L. Boyce, Ph.D.
>> Director, Environmental Science Program
>> Professor
>> Department of Biological Sciences, SC 150
>> Northern Kentucky University
>> Nunn Drive
>> Highland Heights, KY  41099  USA
>>
>> 859-572-1407 (tel.)
>> 859-572-5639 (fax)
>> boy...@nku.edu<mailto:boy...@nku.edu>
>> http://www.nku.edu/~boycer/
>> =
>>
>> "One of the advantages of being disorderly is that one is constantly
>> making exciting discoveries." - A.A. Milne
>>
>>
>>
>>
>>
>>
>>  [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>
>
> --
> Botta-Dukát Zoltán
> ------------
> Ökológiai és Botanikai Intézet
> 

[R-sig-eco] Error when installing packages in R.3.0.2 (Windows 7)

2013-11-08 Thread Manuel Spínola
Dear list members,

I know this si not specifically an ecology R related question, but more
related to R.

I am getting an error when installing any packages:

Error en unzip(zipname, exdir = dest) :
  no fue posible abrir el archivo
'D:/Users/RDuran/Documents/R/win-library/3.0/file1fec20324aee/Rcmdr/doc/Commander-ru.pdf':
Permission denied
Any idea how to solve this issue?

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] How to remove space among columns

2013-03-27 Thread Manuel Spínola
Thank you very much to all of you.

I tried the Bret Collier suggestion and it worked.

Best,

Manuel


2013/3/27 Bret Collier 

> l=data.frame(col1=c(0,1,0), col2=c(1,0,1), col3=c(1, 0, 1), col4=c(0, 0,
> 1), col5=c("a", "a", "b"), col6=c("c", "d", "d"))
> ll=paste(l$col1, l$col2, l$col3, l$col4, sep="")
> data.frame(ll, a=l$col5, b=l$col6)
>
> see ?paste
>
> bret
>
>
> On 3/27/2013 8:15 AM, Manuel Spínola wrote:
>
>> Thank you very much to all that answered my question, some one of you
>> asked
>> me to be more specific, here is my question again:
>>
>> I hava a data frame:
>>
>> col1  col2 col3 col4 col5 col6
>> 01  1 0 ac
>> 10  0 0 ad
>> 01  1 1 bd
>>
>> I want to end with a data frame like this (the first 4 columns without
>> space):
>>
>> 0110 ac
>> 1000 ad
>> 0111 bd
>>
>>
>> Best,
>>
>> Manuel
>>
>>
>>
>> 2013/3/26 Roman Luštrik 
>>
>>  How do you want to remove the space, so that when you print a data frame
>>> that the columns are closer together? Pr perhaps you're trying to merge
>>> column names into a single string? Perhaps something third? Can you
>>> expand
>>> your answer?
>>>
>>> Cheers,
>>> Roman
>>>
>>>
>>>
>>> 2013/3/27 Manuel Spínola 
>>>
>>>  Dera list members,
>>>>
>>>> How to remove spaces among columns in a data frame.
>>>>
>>>> 1 2 3 4  to become 1234
>>>>
>>>> Best,
>>>>
>>>> Manuel
>>>>
>>>> --
>>>> *Manuel Spínola, Ph.D.*
>>>>
>>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>>>
>>>> Universidad Nacional
>>>> Apartado 1350-3000
>>>> Heredia
>>>> COSTA RICA
>>>> mspin...@una.ac.cr
>>>> mspinol...@gmail.com
>>>> Teléfono: (506) 2277-3598
>>>> Fax: (506) 2237-7036
>>>> Personal website: Lobito de río <
>>>>
>>>> https://sites.google.com/site/**lobitoderio/<https://sites.google.com/site/lobitoderio/>
>>>> >
>>>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/**>
>>>>
>>>>  [[alternative HTML version deleted]]
>>>>
>>>>
>>>> __**_
>>>> R-sig-ecology mailing list
>>>> R-sig-ecology@r-project.org
>>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>>>>
>>>>
>>>>
>>>
>>> --
>>> In God we trust, all others bring data.
>>>
>>>
>>
>>
>>
>>
>> __**_
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>>
>>
> __**_
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] How to remove space among columns

2013-03-27 Thread Manuel Spínola
Thank you very much to all that answered my question, some one of you asked
me to be more specific, here is my question again:

I hava a data frame:

col1  col2 col3 col4 col5 col6
01  1 0 ac
10  0 0 ad
01  1 1 bd

I want to end with a data frame like this (the first 4 columns without
space):

0110 ac
1000 ad
0111 bd


Best,

Manuel



2013/3/26 Roman Luštrik 

> How do you want to remove the space, so that when you print a data frame
> that the columns are closer together? Pr perhaps you're trying to merge
> column names into a single string? Perhaps something third? Can you expand
> your answer?
>
> Cheers,
> Roman
>
>
>
> 2013/3/27 Manuel Spínola 
>
>> Dera list members,
>>
>> How to remove spaces among columns in a data frame.
>>
>> 1 2 3 4  to become 1234
>>
>> Best,
>>
>> Manuel
>>
>> --
>> *Manuel Spínola, Ph.D.*
>>
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.ac.cr
>> mspinol...@gmail.com
>> Teléfono: (506) 2277-3598
>> Fax: (506) 2237-7036
>> Personal website: Lobito de río <
>> https://sites.google.com/site/lobitoderio/>
>> Institutional website: ICOMVIS 
>>
>> [[alternative HTML version deleted]]
>>
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>>
>
>
> --
> In God we trust, all others bring data.
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
Institutional website: ICOMVIS 

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] How to remove space among columns

2013-03-26 Thread Manuel Spínola
Dera list members,

How to remove spaces among columns in a data frame.

1 2 3 4  to become 1234

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Error message in adehabitatHR

2013-03-20 Thread Manuel Spínola
Dear list members,

When working with adehabitatHR after fitting a kernel I got the following
erro message that I don´'t understand:

> kud <- kernelUD(analisisUtm[,5], h="href")
> kud
** Utilization distribution of several Animals 

Type: probability density
Smoothing parameter estimated with a  href smoothing parameter
This object is a list with one component per animal.
Each component is an object of class estUD
See estUD-class for more information

> class(kud)
[1] "estUDm"
>
> ver <- getverticeshr(kud, percent=95)
Error: identicalCRS(x, y) is not TRUE


Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Very large dispersion parameter in a negative binomial model

2013-02-03 Thread Manuel Spínola
Thank you very much Mollie.

Best,

Manuel


2013/2/3 Mollie Brooks 

> Hi Manuel,
> This means that your data is closer to Poisson.
> Here is an example where I simulate Poisson data and try to fit the NB
> distribution. I get behavior from glm.nb that is similar to your results
> (large dispersion parameter and warning about iteration limit reached).
>
> x=rep(1:5, 10)
> y=rpois(n=length(x), lambda=exp(x*.5+1))
> dat=data.frame(x=x,y=y)
> library("MASS")
> m1=glm.nb(y~x, dat)
> m2=glm(y~x, dat, family="poisson")
>
> Try using glm instead of glm.nb
>
> cheers,
> Mollie
>
> Mollie Brooks
> Postdoctoral Researcher, Ponciano Lab
> Biology Department, University of Florida
> http://people.biology.ufl.edu/mbrooks
>
>
> On 3 Feb 2013, at 10:16 AM, Manuel Spínola wrote:
>
> Dear list members,
>
> I am fitting a negative binomial model but I get a very large dispersion
> parameter.  Why is that?
>
> quine.nb2 <- glm.nb(Pt ~ Agua + Dist10, data = Abundancia)
>
> summary(quine.nb2)
>
> Deviance Residuals:
> Min1QMedian3Q   Max
> -2.20911  -0.67157   0.04411   0.35695   1.65524
>
> Coefficients:
>  Estimate Std. Error z value Pr(>|z|)
> (Intercept)   -0.883540.43982  -2.009   0.0445 *
> Agua[T.negra]  0.893190.43727   2.043   0.0411 *
> Dist10 0.394160.04387   8.984   <2e-16 ***
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> (Dispersion parameter for Negative Binomial(67552.88) family taken to be 1)
>
>Null deviance: 128.567  on 15  degrees of freedom
> Residual deviance:  17.005  on 13  degrees of freedom
> AIC: 67.058
>
> Number of Fisher Scoring iterations: 1
>
>
>  Theta:  67553
>  Std. Err.:  1428117
> Warning while fitting theta: iteration limit reached
>
> 2 x log-likelihood:  -59.058
>
>
> Best,
>
> Manuel
>
> --
> *Manuel Spínola, Ph.D.*
>
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.ac.cr
> mspinol...@gmail.com
> Teléfono: (506) 2277-3598
> Fax: (506) 2237-7036
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Very large dispersion parameter in a negative binomial model

2013-02-03 Thread Manuel Spínola
Dear list members,

I am fitting a negative binomial model but I get a very large dispersion
parameter.  Why is that?

quine.nb2 <- glm.nb(Pt ~ Agua + Dist10, data = Abundancia)

summary(quine.nb2)

Deviance Residuals:
 Min1QMedian3Q   Max
-2.20911  -0.67157   0.04411   0.35695   1.65524

Coefficients:
  Estimate Std. Error z value Pr(>|z|)
(Intercept)   -0.883540.43982  -2.009   0.0445 *
Agua[T.negra]  0.893190.43727   2.043   0.0411 *
Dist10 0.394160.04387   8.984   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for Negative Binomial(67552.88) family taken to be 1)

Null deviance: 128.567  on 15  degrees of freedom
Residual deviance:  17.005  on 13  degrees of freedom
AIC: 67.058

Number of Fisher Scoring iterations: 1


  Theta:  67553
  Std. Err.:  1428117
Warning while fitting theta: iteration limit reached

 2 x log-likelihood:  -59.058


Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] qAIC

2013-01-22 Thread Manuel Spínola
Dear list members,

I fitted a quasipoisson model and I am trying to get the qAICc with the
function qAICc form the bbmle package I cannot get the value.

quasi <- glm(Pt ~ Agua + offset(log(Transecto.1)),
family=quasipoisson(log), data=Abundancia)

val = qAICc(quasi, dispersion = 9.6567, nobs=16)

val
[1] NA

Thank you very much in advance,

Best,

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Replacing values in a data frame

2012-10-25 Thread Manuel Spínola
Thank you very much Tim.

Best,

Manuel

2012/10/25 Tim Meehan 

> You can also try using ifesle()
>
> A$X2 <- ifelse(A$X2>1, 1, A$X2)
>
>
> On Thu, Oct 25, 2012 at 2:08 PM, Peter Solymos wrote:
>
>> Maybe:
>> A$X2[A$X2>1] <- 1
>>
>> Peter
>>
>> --
>> Péter Sólymos, Dept Biol Sci, Univ Alberta, T6G 2E9, Canada AB
>> soly...@ualberta.ca, Ph 780.492.8534, http://psolymos.github.com
>> Alberta Biodiversity Monitoring Institute, http://www.abmi.ca
>> Boreal Avian Modelling Project, http://www.borealbirds.ca
>>
>>
>> 2012/10/25 Manuel Spínola :
>> > Dear list members,
>> >
>> > I want to replace the values of a numerical variable in a data frame
>> called
>> > "A".
>> >
>> > A
>> > X1X2
>> > 2   1.5
>> > 3    1
>> > 41.2
>> >
>> > How to replace any value greater than 1 by the value 1 in the variable
>> X2.
>> >
>> > Thank you very much in advance.
>> >
>> > Best,
>> >
>> > Manuel
>> >
>> > --
>> > *Manuel Spínola, Ph.D.*
>> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> > Universidad Nacional
>> > Apartado 1350-3000
>> > Heredia
>> > COSTA RICA
>> > mspin...@una.ac.cr
>> > mspinol...@gmail.com
>> > Teléfono: (506) 2277-3598
>> > Fax: (506) 2237-7036
>> > Personal website: Lobito de río <
>> https://sites.google.com/site/lobitoderio/>
>> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>> >
>> > [[alternative HTML version deleted]]
>> >
>> >
>> > ___
>> > R-sig-ecology mailing list
>> > R-sig-ecology@r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>> >
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Replacing values in a data frame

2012-10-25 Thread Manuel Spínola
Thank you very much Sarah.

No, just to replace the values greater than 1 in X2.

Best,

Manuel

2012/10/25 Sarah Goslee 

> Hi,
>
> 2012/10/25 Manuel Spínola :
> > Dear list members,
> >
> > I want to replace the values of a numerical variable in a data frame
> called
> > "A".
> >
> > A
> > X1X2
> > 2   1.5
> > 31
> > 41.2
> >
> > How to replace any value greater than 1 by the value 1 in the variable
> X2.
>
> I think you made a typo? I'm assuming you want to replace values in
> column X1 that are greater than 1 with the values in X2? All of your
> X1 are greater than 1 in your test example, but:
>
> with(A, ifelse(X1 > 1, X2, X1))
> or
> A$X1[A$X1 > 1] <- A$X2[A$X1 > 1]
>
>
> Sarah
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Replacing values in a data frame

2012-10-25 Thread Manuel Spínola
Dear list members,

I want to replace the values of a numerical variable in a data frame called
"A".

A
X1X2
2   1.5
31
41.2

How to replace any value greater than 1 by the value 1 in the variable X2.

Thank you very much in advance.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Comparing survival curves

2012-09-06 Thread Manuel Spínola
Adrian,

You can take a look at the R package wild1.

Best,

Manuel Spínola

2012/9/6 AdRiAnA HuMaNeS 

> Hi Rlisters:
>
> I'm doing survival analysis comparing 8 populations. I've used the
> survdiff function for comparing survival curves and the result I obtained
> says that the survivorship curves are different (p=1.55e-15). Now I want to
> know if all the curves differ or if there are some of them that don't. What
> function should I use for doing this comparison? I thought about running
> the test again with every possible comparison between the populations, but
> this seems like the long way of doing this. Sorry if this is a silly
> question but I'm not too familiar using R.
> Thanks in advance,
>
> Adriana Humanes
>
> Sobrevivencia <- read.table(file="Rec_surv_adri_all_tiles.txt",
> header=TRUE)
> summary(Sobrevivencia)
> attach(Sobrevivencia)
> library(survival)
> Sobrevivencia.surv <- Surv(age, status)
> survdiff(Sobrevivencia.surv~reef)
> adri.fit=survfit(Sobrevivencia.surv~reef)
> survdiff(Sobrevivencia.surv~reef)
> summary(adri.fit)
> plot(adri.fit, lty=1:8, col=1:8)
> legend("bottomleft", c("Dunk", "Fitzroy", "Hannah", "Hay", "High",
> "MacDonalds", "Russell", "Wilkie"), lty=1:8, col=1:8) #leyenda
>
> [[alternative HTML version deleted]]
>
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Understanding cbind

2012-07-22 Thread Manuel Spínola
Thank you very much Phil.

Manuel

2012/7/20 Phil Novack-Gottshall 

>  Dear Manuel,
>
> This is not a matrix versus data-frame issue. The difference is because in
> the first case you are extracting multiple items at a time, so the column
> names are attached. But in the second, you are really only extracting
> individual items, and so the column names are not necessary.
>
> Here's a simple example:
> DET <- as.matrix(finaldf[,3:6]) # Attaches the column names
>
> DET <- as.matrix(finaldf[,3]) # Does not.
>
> DET <- as.matrix(finaldf[,c(3, 5)]) # Also does not.
>
> DET <- as.data.frame(finaldf[,3:6]) # Also attaches the column names
>
> DET <- as.data.framefinaldf[,3]) # Also does not.
>
> DET <- as.data.frame(finaldf[,c(3, 5)]) # Also does not.
>
>
> Hope this helps,
> Phil
>
>
>
> On 7/20/2012 11:13 AM, Manuel Spínola wrote:
>
> Dear list members,
>
> I am using function cbind but I got 2 different results, one is a data
> frame and the other is a matrix and I would like to undertand why is the
> reason:
>
> I have a data frame called "finaldf"
>
>
>  names(finaldf)
>
>   [1] "especie" "estrato" "oc1" "oc2" "oc3" "oc4" "oc5"
> "oc6"
>  [9] "oc7" "oc8" "oc9" "oc10""oc11""oc12""oc13"
>  "oc14"
> [17] "oc15""oc16""oc17""oc18""oc19""oc20"
>
> I tried (gave me  a data frame):
>
> DET <- cbind(finaldf[, 3:22])
>
>
>  head(DET)
>
> oc1 oc2 oc3 oc4 oc5 oc6 oc7 oc8 oc9 oc10 oc11 oc12 oc13 oc14 oc15 oc16
> oc17 oc18
> 10   0   0   0   0   0   0   0   10000000
>  00
> 27   0   0   0   1   0   0   0   0   00000001
>  00
> 53   0   0   0   0   0   0   0   0   00000000
>  00
> 21   1   1   1   1   1   0   1   11110101
>  11
> 28   1   0   1   0   1   1   1   1   11110111
>  10
> 54   1   1   1   1   1   1   1   1   00011010
>  00
>oc19 oc20
> 1 00
> 2710
> 5300
> 2 11
> 2810
> 5401
>
> and gave me a different results when I tried (gave me a matrix):
>
> DET <-  cbind(finaldf$oc1, finaldf$oc2, finaldf$oc3, finaldf$oc4,
> finaldf$oc5, finaldf$oc6, finaldf$oc7, finaldf$oc8, finaldf$oc9,
> finaldf$oc10, finaldf$oc11, finaldf$oc12, finaldf$oc13, finaldf$oc14,
> finaldf$oc15, finaldf$oc16, finaldf$oc17, finaldf$oc18, finaldf$oc19,
> finaldf$oc20)
>
>
>  head(DET)
>
>   [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
> [,14]
> [1,]000000001 0 0 0 0
>   0
> [2,]000100000 0 0 0 0
>   0
> [3,]000000000 0 0 0 0
>   0
> [4,]111111011 1 1 1 0
>   1
> [5,]101011111 1 1 1 0
>   1
> [6,]1111111    10 0 0 1 1
>   0
>  [,15] [,16] [,17] [,18] [,19] [,20]
> [1,] 0 0 0 0 0 0
> [2,] 0 1 0 0 1 0
> [3,] 0 0 0 0 0 0
> [4,] 0 1 1 1 1 1
> [5,] 1 1 1 0 1 0
> [6,] 1 0 0 0 0 1
>
> Best,
>
> Manuel
>
>
>
>
>
> ___
> R-sig-ecology mailing 
> listR-sig-ecology@r-project.orghttps://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Understanding cbind

2012-07-20 Thread Manuel Spínola
Dear list members,

I am using function cbind but I got 2 different results, one is a data
frame and the other is a matrix and I would like to undertand why is the
reason:

I have a data frame called "finaldf"

> names(finaldf)
 [1] "especie" "estrato" "oc1" "oc2" "oc3" "oc4" "oc5"
"oc6"
 [9] "oc7" "oc8" "oc9" "oc10""oc11""oc12""oc13"
 "oc14"
[17] "oc15""oc16""oc17""oc18""oc19""oc20"

I tried (gave me  a data frame):

DET <- cbind(finaldf[, 3:22])

> head(DET)
   oc1 oc2 oc3 oc4 oc5 oc6 oc7 oc8 oc9 oc10 oc11 oc12 oc13 oc14 oc15 oc16
oc17 oc18
10   0   0   0   0   0   0   0   10000000
 00
27   0   0   0   1   0   0   0   0   00000001
 00
53   0   0   0   0   0   0   0   0   00000000
 00
21   1   1   1   1   1   0   1   11110101
 11
28   1   0   1   0   1   1   1   1   11110111
 10
54   1   1   1   1   1   1   1   1   00011010
 00
   oc19 oc20
1 00
2710
5300
2 11
2810
5401

and gave me a different results when I tried (gave me a matrix):

DET <-  cbind(finaldf$oc1, finaldf$oc2, finaldf$oc3, finaldf$oc4,
finaldf$oc5, finaldf$oc6, finaldf$oc7, finaldf$oc8, finaldf$oc9,
finaldf$oc10, finaldf$oc11, finaldf$oc12, finaldf$oc13, finaldf$oc14,
finaldf$oc15, finaldf$oc16, finaldf$oc17, finaldf$oc18, finaldf$oc19,
finaldf$oc20)

> head(DET)
 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[,14]
[1,]000000001 0 0 0 0
  0
[2,]000100000 0 0 0 0
  0
[3,]000000000 0 0 0 0
  0
[4,]111111011 1 1 1 0
  1
[5,]101011111 1 1 1 0
  1
[6,]111111110 0 0 1 1
  0
 [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0     0     0
[2,] 0 1 0 0 1 0
[3,] 0 0 0 0 0 0
[4,] 0 1 1 1 1 1
[5,] 1 1 1 0 1 0
[6,] 1 0 0 0 0 1

Best,

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Example on trend analysis for biological monitoring

2012-07-15 Thread Manuel Spínola
Hi Stephen,

Few years ago I published a paper on population trend analysis on quails
applying the approach of Fewster 2000 (Generalized additive model), but I
am looking something simple to teach on a course on monitoring
biodiversity.  Something if you have several years measuring a population
parameters in one site., and another example where you have several sites.
 The people that I will be teaching do not have much experience on R.

Best,

Manuel

2012/7/15 Stephen Sefick 

>  I don't know of one specifically, but what are you trying to do?
>
> Stephen
>
>
> On 07/14/2012 10:05 AM, Manuel Spínola wrote:
>
> Dear list members,
>
> Is there any simple example for teaching purposes on how to use R to
> analyze a time series in a biological monitoring context?
>
> Best,
>
> Manuel
>
>
>
>
> ___
> R-sig-ecology mailing 
> listR-sig-ecology@r-project.orghttps://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Example on trend analysis for biological monitoring

2012-07-14 Thread Manuel Spínola
Dear list members,

Is there any simple example for teaching purposes on how to use R to
analyze a time series in a biological monitoring context?

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Recode several variables with conditions in a data frame

2012-07-03 Thread Manuel Spínola
Thank you very much Bret.

Best,

Manuel

2012/7/3 Bret Collier 

> Not very elegant or efficient, but for only a couple of columns needing
> left out something simple like this should work.
>
> xx=data.frame(x=c(2, 10), y=c(2, 0), z=c(4, 3))
> yy=xx[,2:3]
> yy[yy!=0]=1
> data.frame(x=xx[,1], yy)
>
> bret
>
>
>
>
> On 7/3/2012 9:18 PM, Manuel Spínola wrote:
>
>> Thank you Bret.
>>
>> What if I need to leave out some variables from my data frame.  I have 22
>> variables and I need to leave the 2 first variables out of the condition.
>>
>> Best,
>>
>> Manuel
>>
>> 2012/7/3 Bret Collier 
>>
>>  Manuel,
>>> Something like this should work for your example.
>>>
>>> xx=data.frame(x=c(2, 10), y=c(2, 0))
>>> xx[xx!=0]=1
>>> xx
>>>x y
>>> 1 1 1
>>> 2 1 0
>>>
>>> Bret
>>>
>>>
>>> On 7/3/2012 8:12 PM, Manuel Spínola wrote:
>>>
>>>  Dear list members,
>>>>
>>>> I want to recode a data frame but do it for several variables at the
>>>> same
>>>> time.  I want to give all the values > or equal than 1 a value of 1 and
>>>> all
>>>> the remaining values (0) keep in 0.
>>>>
>>>> data.frame: newdf
>>>>
>>>> var1 var2 var3 var4
>>>> A   1  0 4
>>>> B   3  2 1
>>>> C   0  5 1
>>>>
>>>> My real data frame has several more variables.
>>>>
>>>> I am using the recode function from the epicalc package:
>>>>
>>>>   recode(vars=newdf[, 2:4], old.value= newdf[, 2:4] >= 1, new.value=1)
>>>>
>>>>>
>>>>>
>>>> Error en recode.default(vars = newdf[, 2:4], old.value = newdf[, 2:4] >=
>>>>   :
>>>> objeto '.data' no encontrado
>>>>
>>>> I guess I am not setting the condition in a proper way.
>>>>
>>>> Best,
>>>>
>>>> Manuel
>>>>
>>>>
>>>>
>>>> ___
>>>> R-sig-ecology mailing list
>>>> R-sig-ecology@r-project.org
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology>
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>>>> >
>>>>
>>>>
>>>>  ___
>>> R-sig-ecology mailing list
>>> R-sig-ecology@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology>
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>>> >
>>>
>>>
>>
>>
>>
> __**_
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Recode several variables with conditions in a data frame

2012-07-03 Thread Manuel Spínola
Thank you Bret.

What if I need to leave out some variables from my data frame.  I have 22
variables and I need to leave the 2 first variables out of the condition.

Best,

Manuel

2012/7/3 Bret Collier 

> Manuel,
> Something like this should work for your example.
>
> xx=data.frame(x=c(2, 10), y=c(2, 0))
> xx[xx!=0]=1
> xx
>   x y
> 1 1 1
> 2 1 0
>
> Bret
>
>
> On 7/3/2012 8:12 PM, Manuel Spínola wrote:
>
>> Dear list members,
>>
>> I want to recode a data frame but do it for several variables at the same
>> time.  I want to give all the values > or equal than 1 a value of 1 and
>> all
>> the remaining values (0) keep in 0.
>>
>> data.frame: newdf
>>
>> var1 var2 var3 var4
>> A   1  0 4
>> B   3  2 1
>> C   0  5 1
>>
>> My real data frame has several more variables.
>>
>> I am using the recode function from the epicalc package:
>>
>>  recode(vars=newdf[, 2:4], old.value= newdf[, 2:4] >= 1, new.value=1)
>>>
>>
>> Error en recode.default(vars = newdf[, 2:4], old.value = newdf[, 2:4] >=
>>  :
>>objeto '.data' no encontrado
>>
>> I guess I am not setting the condition in a proper way.
>>
>> Best,
>>
>> Manuel
>>
>>
>>
>> __**_
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>>
>>
> __**_
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology<https://stat.ethz.ch/mailman/listinfo/r-sig-ecology>
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Recode several variables with conditions in a data frame

2012-07-03 Thread Manuel Spínola
Dear list members,

I want to recode a data frame but do it for several variables at the same
time.  I want to give all the values > or equal than 1 a value of 1 and all
the remaining values (0) keep in 0.

data.frame: newdf

var1 var2 var3 var4
A   1  0 4
B   3  2 1
C   0  5 1

My real data frame has several more variables.

I am using the recode function from the epicalc package:

> recode(vars=newdf[, 2:4], old.value= newdf[, 2:4] >= 1, new.value=1)

Error en recode.default(vars = newdf[, 2:4], old.value = newdf[, 2:4] >=  :
  objeto '.data' no encontrado

I guess I am not setting the condition in a proper way.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Re-arrange data frame

2012-06-29 Thread Manuel Spínola
Dear List members,

How can I re-arrange a data frame as detailed below.

old data frame

Item  col1  col2 col3 col4

item1  12116  7
item2  108 5  4
item3  3  5 4  3

New data frame

item1  12   11
item1   6 7
item2  108
item2   5 4
item3  3  5
item3  4  3

Best,

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Carrying capacity in R

2012-06-29 Thread Manuel Spínola
Thank you very much Peter.

Manuel

2012/6/28 Peter Solymos 

> Manuel,
>
> As a starter you can fit nonlinear models using growth functions, and
> calculate carrying capacity from estimated model parameters
> (stats:::nle, lme4:::nlmer).
>
> I am not sure if this is of big help as it is still in development,
> but our PVAClone R package is almost ready for its 1st CRAN submission
> and can be found at the developmental R-Forge site:
> https://r-forge.r-project.org/projects/dcr/
>
> The PVAClone package offers likelihood based population viability
> analysis in the presence of observation error and missing data.
> Currently it can be used to fit and compare support for models based
> on Gompertz and Ricker growth models with no observation error, Normal
> or Poisson observation error as described in these papers (other
> growth models and forecasting is soon to be added):
>
> Ponciano, J. M. et al. 2009. Hierarchical models in ecology:
> confidence intervals, hypothesis testing, and model selection using
> data cloning. Ecology 90, 356-362.
>
> Nadeem, K., Lele S. R., 2012.  Likelihood based population viability
> analysis in the presence of observation error. Oikos. doi:
> 10./j.1600-0706.2011.20010.x
>
> Cheers,
>
> Peter
>
> --
> Péter Sólymos, Dept Biol Sci, Univ Alberta, T6G 2E9, Canada AB
> soly...@ualberta.ca, Ph 780.492.8534, http://psolymos.github.com
> Alberta Biodiversity Monitoring Institute, http://www.abmi.ca
> Boreal Avian Modelling Project, http://www.borealbirds.ca
>
>
> 2012/6/28 Manuel Spínola :
> > Dear list members,
> >
> > Is there any package (and function) to assess carrying capacity for
> > biological population?
> >
> > Best,
> >
> > Manuel
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.ac.cr
> > mspinol...@gmail.com
> > Teléfono: (506) 2277-3598
> > Fax: (506) 2237-7036
> > Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >
> >[[alternative HTML version deleted]]
> >
> >
> > ___
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Carrying capacity in R

2012-06-28 Thread Manuel Spínola
Dear list members,

Is there any package (and function) to assess carrying capacity for
biological population?

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] NMDS with metaMDS from vegan following an example from Numerical Ecology with R

2012-06-12 Thread Manuel Spínola
Thank you very much Jari,

Using weakties = FALSE it works very well.  The results are similar to the
book.

Best,

Manuel

> e.mds = metaMDS(especies, distance = "bray", weakties = FALSE)
Run 0 stress 0.1088505
Run 1 stress 0.113103
Run 2 stress 0.1356066
Run 3 stress 0.1088552
... procrustes: rmse 0.1304834  max resid 0.4025236
Run 4 stress 0.1403525
Run 5 stress 0.3915359
Run 6 stress 0.1305611
Run 7 stress 0.1417557
Run 8 stress 0.1088584
... procrustes: rmse 0.001626811  max resid 0.007608109
*** Solution reached

Mensajes de aviso perdidos
In distfun(comm, method = distance, ...) :
  you have empty rows: their dissimilarities may be meaningless in method
“bray”

2012/6/12 Jari Oksanen 

>
> On 13/06/2012, at 07:33 AM, Manuel Spínola wrote:
>
> > Dear list members,
> >
> > I am working on an NMDS using metaMDS from vegan with the Doubs fish data
> > from the book Numerical ecology with R.
> >
> >> especies <- read.csv("DoubsSpe.csv", row.names = 1)
> >> e.mds = metaMDS(especies, distance = "bray")
> > Run 0 stress 0.003706943
> > Run 1 stress 0.0004788424
> > ... New best solution
> > ... procrustes: rmse 0.009197047  max resid 0.01874812
> > Run 2 stress 0.0004600702
> > ... New best solution
> > ... procrustes: rmse 0.0002883791  max resid 0.0005590752
> > *** Solution reached
> >
> > Mensajes de aviso perdidos
> > In distfun(comm, method = distance, ...) :
> >  you have empty rows: their dissimilarities may be meaningless in method
> > „bray‰
> >>
> >
> > My results are "strange" (stress is too low and different to the one on
> the
> > book) and the plot is very different to the one that appears in the book.
> >
> Manuel,
>
> I'm too lazy to go to have a look at the book now (I'm sitting in my
> balcony sipping my morning coffee), but I assume that the difference is
> that metaMDS in your book was still based on MASS::isoMDS(), but the
> current vegan (from 2.0-0) uses its own monoMDS() function as a default.
> One difference is that isoMDS() expresses the stress per cent, and
> monoMDS() as parts of one, so that equal isoMDS() is 100x higher. Another
> difference is that monoMDS() implements treatment of tied dissimilarity
> values, and defaults to "weak" ties so that equal observed dissimilarities
> can be allowed to be at different ordination distances. If I remember
> correctly, these Doubs fish data are very simple so that monoMDS() really
> may be able to have nearly zero stress (which is suspect in general).
>
> For better correspondence to the book, you may first try setting 'weakties
> = FALSE' which will force tie treatment that is closer to isoMDS(), but
> still not identical. For true replication of the book results you should
> set 'engine = "isoMDS"'.
>
> As usual, these are documented features.
>
> Cheers, Jari Oksanen
> --
> Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland
> jari.oksa...@oulu.fi, Ph. +358 400 408593, http://cc.oulu.fi/~jarioksa
>
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
Institutional website: ICOMVIS 

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] NMDS with metaMDS from vegan following an example from Numerical Ecology with R

2012-06-12 Thread Manuel Spínola
Dear list members,

I am working on an NMDS using metaMDS from vegan with the Doubs fish data
from the book Numerical ecology with R.

> especies <- read.csv("DoubsSpe.csv", row.names = 1)
> e.mds = metaMDS(especies, distance = "bray")
Run 0 stress 0.003706943
Run 1 stress 0.0004788424
... New best solution
... procrustes: rmse 0.009197047  max resid 0.01874812
Run 2 stress 0.0004600702
... New best solution
... procrustes: rmse 0.0002883791  max resid 0.0005590752
*** Solution reached

Mensajes de aviso perdidos
In distfun(comm, method = distance, ...) :
  you have empty rows: their dissimilarities may be meaningless in method
“bray”
>

My results are "strange" (stress is too low and different to the one on the
book) and the plot is very different to the one that appears in the book.

Any clue what is the problem?

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] R and WinBUGS

2012-03-29 Thread Manuel Spínola
Dear list members,

This is not a very specific question on R for ecological analysis, but is
related.

I have been in courses where R and WinBugs are used together for data
analysis, however, I still don´t understand why R need to use WinBUGS to
perform some bayesian analysis.

I teach statistics through R for graduate students, however, teaching
bayesian statistics using R and Winbugs is not so intuitive.  Is harder for
them to grasp bayesian statistics in that way.  I have read form several
authors that bayesian statistics is more intuitive than frecuentist
statistics, however, doing through R and WInBUGS, is not the case for
students.

For example I think student will understand more what they are doing if
they only see a line of code for R where you can specify everything and do
it only in R, rather than writing things for R and things for WinBUGS.

Is really WinBUGS necessary?  Is R not capable of doing the same type of
analysis?

Any input will be appreciated.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Using partykit::ctree with observations that are spatially autocorrelated

2012-03-22 Thread Manuel Spínola
What you say makes sense to me Kay.

Best,

Manuel

2012/3/21 Kay Cichini 

> manuel,
>
> the sites where sampled repeatedly, such that the detection probability is
> sufficiently high. some occurrences might be overseen, but as i am not
> interested in the abundances or occurrence-rate per se i can live with
> missing some.
>
> another problem of regression like models is that i would not be can't
> include too many interactions because I soon will have some
> over-parameterisation... ctree can deal with this quite well, as far as i
> can tell.
>
> another point is that the practitioner that will be presented the results
> won't be very happy with
> regression-cofficients, model-comparisons, AIC and friends. contrary,
> ctree would yield an intuitive and simple result which i would fancy for
> this purpose!
>
> yours,
> kay
>
>
>
> 2012/3/21 Manuel Spínola 
>
>> That is true, but it can deal with detectability, and I am afraid ctree
>> cannot.
>>
>> Best,
>>
>> Manuel
>>
>> 2012/3/21 Kay Cichini 
>>
>>> thanks manuel,
>>>
>>> i'm afraid unmarked can not deal with spatial autocorrelation -
>>> see this post:
>>> http://groups.google.com/group/unmarked/browse_thread/thread/f45bd5ab12aa127d/26446409f3e2a140?lnk=gst&q=spatial%23#26446409f3e2a140
>>>
>>> best,
>>> kay
>>>
>>>
>>> 2012/3/20 Manuel Spínola 
>>>
>>>> You need to look in the "unmarked" package.
>>>>
>>>> Best,
>>>>
>>>> Manuel Spínola
>>>>
>>>> 2012/3/20 Isidore AMAHOWE 
>>>>
>>>> > This may be possible with an R packages but i don't know. What i've
>>>> been
>>>> > told is that a kind of analysis can be done with accupancy analysis
>>>> and
>>>> > this will give possibility to model the envioronmental factors that
>>>> can
>>>> > determine the presence of animal species. But this need a probabilitic
>>>> > method.
>>>> > good luck
>>>> >
>>>>
>>>
>>
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.ac.cr
>> mspinol...@gmail.com
>> Teléfono: (506) 2277-3598
>> Fax: (506) 2237-7036
>> Personal website: Lobito de río<https://sites.google.com/site/lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Using partykit::ctree with observations that are spatially autocorrelated

2012-03-21 Thread Manuel Spínola
That is true, but it can deal with detectability, and I am afraid ctree
cannot.

Best,

Manuel

2012/3/21 Kay Cichini 

> thanks manuel,
>
> i'm afraid unmarked can not deal with spatial autocorrelation -
> see this post:
> http://groups.google.com/group/unmarked/browse_thread/thread/f45bd5ab12aa127d/26446409f3e2a140?lnk=gst&q=spatial%23#26446409f3e2a140
>
> best,
> kay
>
>
> 2012/3/20 Manuel Spínola 
>
>> You need to look in the "unmarked" package.
>>
>> Best,
>>
>> Manuel Spínola
>>
>> 2012/3/20 Isidore AMAHOWE 
>>
>> > This may be possible with an R packages but i don't know. What i've been
>> > told is that a kind of analysis can be done with accupancy analysis and
>> > this will give possibility to model the envioronmental factors that can
>> > determine the presence of animal species. But this need a probabilitic
>> > method.
>> > good luck
>> >
>>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] R-sig-ecology Digest, Vol 48, Issue 16

2012-03-20 Thread Manuel Spínola
You need to look in the "unmarked" package.

Best,

Manuel Spínola

2012/3/20 Isidore AMAHOWE 

> This may be possible with an R packages but i don't know. What i've been
> told is that a kind of analysis can be done with accupancy analysis and
> this will give possibility to model the envioronmental factors that can
> determine the presence of animal species. But this need a probabilitic
> method.
> good luck
>
> 2012/3/20 
>
> > Send R-sig-ecology mailing list submissions to
> >r-sig-ecology@r-project.org
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> > or, via email, send a message with subject or body 'help' to
> >r-sig-ecology-requ...@r-project.org
> >
> > You can reach the person managing the list at
> >r-sig-ecology-ow...@r-project.org
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of R-sig-ecology digest..."
> >
> >
> > Today's Topics:
> >
> >   1. Using partykit::ctree with observations that are  spatially
> >  autocorrelated (Kay Cichini)
> >
> >
> > --
> >
> > Message: 1
> > Date: Mon, 19 Mar 2012 18:04:59 +0100
> > From: Kay Cichini 
> > To: r-sig-ecology@r-project.org
> > Subject: [R-sig-eco] Using partykit::ctree with observations that are
> >spatially autocorrelated
> > Message-ID:
> > nwtygc2qob7f...@mail.gmail.com
> > >
> > Content-Type: text/plain
> >
> > Hello list members,
> >
> > I'm planning to model species presence / absence data (N = 523) that was
> > collected over a geographic area. Samples come from preferential sites
> (sea
> > level > 1200 m, obligatory presence of permanent waterbodies, etc). I
> want
> > to infere on environmental factors determining the occurrence rate of
> > several amphibian species.
> >
> > I want to use partykit::ctree because the method is intuitive and the
> > output is very illustrative.  I want to use the resulting plots as
> decision
> > trees for practitioners. Generally, I need to keep the analyses as simple
> > as possible.
> >
> > May only problem is that I'm afraid that there is some amount of
> > autocorrelation in my variables. I'm thinking about simply using a
> > conservative minimal criterion - say, p > 0.9 or 0.8 and live with it -
> > what do you think?
> >
> > Which tests for detecting spatial autocorrelation within dichotomous
> > responses do you suggest?
> >
> > Or, can I consider the spatial correlation being irrelevant if I assume
> > that it is allowed for by the covariates?
> >
> > Any ideas would be greatly appreciated!
> >
> > Thanks,
> > Kay
> >
> >[[alternative HTML version deleted]]
> >
> >
> >
> > --
> >
> > _______
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
> >
> > End of R-sig-ecology Digest, Vol 48, Issue 16
> > *
> >
>
>
>
> --
>  Isidore
>
>[[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Landscape ecology in R

2012-03-12 Thread Manuel Spínola
Dear list members,

Related to my original post on Landscape Ecology in R:

Richard Plant (UC Davis) just sent me a message that his book came
out: *Spatial
Data Analysis in Ecology a**nd Agriculture using R*

http://www.crcpress.com/product/isbn/9781439819135

Best,

Manuel

2012/3/10 Stephen Sefick 

>  Third hit in a google search for: landscape ecology R
>
> http://nricaribou.cc.umanitoba.ca/R/
>
>
> On 03/09/2012 04:53 PM, Manuel Spínola wrote:
>
> Dear list members,
>
> I am looking for any reference or material on landscape ecology analysis in
> R.
>
> Thank you very much in advance.
>
> Best,
>
> Manuel
>
>
>
>
> ___
> R-sig-ecology mailing 
> listR-sig-ecology@r-project.orghttps://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
> --
> Stephen Sefick
> **
> Auburn University
> Biological Sciences
> 331 Funchess Hall
> Auburn, Alabama
> 36849
> **sas0...@auburn.edu  
> http://www.auburn.edu/~sas0025
> **
>
> Let's not spend our time and resources thinking about things that are so 
> little or so large that all they really do for us is puff us up and make us 
> feel like gods.  We are mammals, and have not exhausted the annoying little 
> problems of being mammals.
>
> -K. Mullis
>
> "A big computer, a complex algorithm and a long time does not equal science."
>
>   -Robert Gentleman
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Fwd: Landscape ecology in R

2012-03-11 Thread Manuel Spínola
-- Forwarded message --
From: Manuel Spínola 
Date: 2012/3/11
Subject: Re: [R-sig-eco] Landscape ecology in R
To: Sarah Goslee 


Thank you Sarah and Stephen,

I am in contact with Paul Galpern who developed some tutorials on landscape
ecology in R (the ones that Stephen pointed out).  He told me that he plan
to release more in the following months. I offered him my contributions
because I have some r code to develop spatially explicit occupancy models
using landscape metrics, combining the raster, dismo and unmarked packages.
I know that Kevin McGarigal at U Mass has some R material too.

My idea with the message was to know if there is some tutorial on how to
use r because many tools on landscape ecology analysis are produced as
tools or extensions fro commercial software such as ArcView or ArcGis. Even
open source QGIS do not have a well developed landscape analysis tools for
landscape ecology, except the one developed for GRASS.

Is not a bad idea to develop R material for landscape ecology.  I know that
there are a lot of packages or tools that can do the job but I am thinking
on some good tutorials on how to combine those tools.  I am an advocate of
R and open source material and I am sure many in our list would like to use
as teaching material. I am teaching a course on wildlife habitat evaluation
(that include a lot of material on Landscape Ecology) and I am using R for
the labs.  The students really like to see all these analysis in R.

Best,

Manuel


2012/3/11 Sarah Goslee 

> Hi Manuel,
>
> I've taken the liberty of adding the r-help list back to this email, even
> though
> you sent your reply just to me, so that others may contribute.
>
> On Fri, Mar 9, 2012 at 6:27 PM, Manuel Spínola 
> wrote:
> > Thank you Sarah,
> >
> > I am thinking more on habitat mapping and landscape metrics.
>
> Then you've probably seen the adehabitat* and SDMTools packages.
>
> > I have been using several packages but I would like to see something more
> > integrated for teaching.  It appear that there is a landscape package
> but I
> > am trying to see where can I download it.
>
> The "R Way" is to have many special-purpose packages: task views are very
> useful to streamline installation. What specifically are you looking for
> that
> what you're using doesn't provide?
>
> I don't think there's a landscape package yet, just plans to create a
> landscape
> package, although I have no idea what's it's intended to do.
>
> Sarah
>
> > 2012/3/9 Sarah Goslee 
> >>
> >> What kind of landscape ecology analysis? There's a whole
> >> task view on spatial analysis. There's another task view
> >> on environmetrics. Both have material of interest to landscape
> >> ecologists. There are various packages
> >> that do habitat mapping, and landscape metrics, or interface
> >> with GIS software.
> >>
> >> Landscape ecology is such a broad discipline that we need
> >> more context to answer in more detail, but there's plenty of
> >> relevant material.
> >>
> >> I'm teaching a workshop on R for landscape ecologists
> >> at the US-IALE meeting next month, incidentally.
> >>
> >> Sarah
> >>
> >> On Fri, Mar 9, 2012 at 5:53 PM, Manuel Spínola 
> >> wrote:
> >> > Dear list members,
> >> >
> >> > I am looking for any reference or material on landscape ecology
> analysis
> >> > in
> >> > R.
> >> >
> >> > Thank you very much in advance.
> >> >
> >> > Best,
> >> >
> >> > Manuel
> >> >
>
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Landscape ecology in R

2012-03-09 Thread Manuel Spínola
Dear list members,

I am looking for any reference or material on landscape ecology analysis in
R.

Thank you very much in advance.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Predict with 2 factors in an additive model

2011-10-14 Thread Manuel Spínola
Dear list members,

I have an additive linear model (see below fro a reproducible example) and I
want to use the function "predict" to have the value of the response
variable for each level of factor f1 and each level of factor f2 in the
additive model (not interaction). When I did predict I only get 2 values.

y=rnorm(40,1,1)

f1=c(rep("a",20),rep("b",20))
f2=c(rep("a",10),rep("b",10),rep("a",10),rep("b",10))

data=data.frame(y,f1,f2)

mod1 = lm(y ~ f1 + f2, data=data)

summary(mod1)

newData = data.frame(f1 = factor(c("a", "b")), f2 = factor(c("b", "a")))

> predict(mod1, newdata = newData, appendData  =  TRUE)
1 2
1.0460148 0.9468983

Thank you very much in advance.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Change the text in the strips of a Lattice plot

2011-06-24 Thread Manuel Spínola
That works perfect.

Thank you very much Johannes.

Best,

Manuel

2011/6/24 Johannes Signer 

> Does that help you?
>
> library(lattice)
> library(datasets)
> data(CO2)
>
> levels(CO2$Type) <- c("A", "B")
> levels(CO2$Treatment) <- c("no enfriado", "enfriado")
>
> xyplot(uptake ~ conc | Type * Treatment,
>  groups = Plant, type = "b", lty = rep(1:3, 4), strip = strip.custom(
> var.name = c("Type",
>  "Treatment "), strip.names = c(T,T), style = 3), data = CO2)
>
>
> Johannes
>
> On Fri, Jun 24, 2011 at 8:18 AM, Manuel Spínola 
> wrote:
> > Dear list members,
> >
> > I am trying the following plot in Lattice:
> >
> > library(lattice)
> > library(datasets)
> > data(CO2)
> >
> > xyplot(uptake ~ conc | Type * Treatment,
> >  groups = Plant, type = "b", lty = rep(1:3, 4), strip = strip.custom(
> > var.name = c("Type",
> >  "Treatment "), strip.names = c(T,T), style = 3), data = CO2)
> >
> > How can I change the names of the levels of the 2 conditioning variables
> in
> > the strip?
> >
> > I want to use: "Enfriado" and "No enfriado" instead of "chilled" and
> > "nonchilled" for Treatmente, and "A" and "B" instead of "Quebec" and
> > "Mississippi" for Type.
> >
> >
> > Thank you very much in advance.
> >
> > Manuel
> >
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.ac.cr
> > mspinol...@gmail.com
> > Teléfono: (506) 2277-3598
> > Fax: (506) 2237-7036
> > Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >
> >[[alternative HTML version deleted]]
> >
> >
> > ___
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
> >
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Change the text in the strips of a Lattice plot

2011-06-24 Thread Manuel Spínola
Dear list members,

I am trying the following plot in Lattice:

library(lattice)
library(datasets)
data(CO2)

xyplot(uptake ~ conc | Type * Treatment,
  groups = Plant, type = "b", lty = rep(1:3, 4), strip = strip.custom(
var.name = c("Type",
  "Treatment "), strip.names = c(T,T), style = 3), data = CO2)

How can I change the names of the levels of the 2 conditioning variables in
the strip?

I want to use: "Enfriado" and "No enfriado" instead of "chilled" and
"nonchilled" for Treatmente, and "A" and "B" instead of "Quebec" and
"Mississippi" for Type.


Thank you very much in advance.

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] subsetting data in R

2011-04-26 Thread Manuel Spínola
Thank you very much Ben.

I was doing an analysis of indicator species with the subset data and 
the other levels were still in my subset data and the analysis was 
considering them in the analysis.
My 3000 columns are plant species presence/absence type of data.

Best,

Manuel

On 26/04/2011 12:06 p.m., Ben Bolker wrote:
>If this isn't already answered:
>
>I don't quite understand the question: what do you mean by "do a
> complete data set from an object in R"?  What do you mean by "the
> subsetting is dangerous ... as you need to specify the levels for all
> your factors again"?
>
>(What do your 3000 columns of data represent?  If these are predictor
> variables I hope you have a truly enormous number of responses ...)
>
>It may have been mentioned already, but droplevels(subset(...)) will
> probably do what you want.  (I have tried very hard over the years to
> get drop.levels= to be an optional argument to subset(), but so far I
> have failed.  droplevels() is an improvement over the drop.levels()
> function in gdata because (1) it is in base R and (2) it doesn't reorder
> the factor by default (which is what gdata::drop.levels [insanely in my
> opinion] does).
>
> On 11-04-24 11:21 AM, Manuel Spínola wrote:
>> Thank you for all the responses.
>>
>> Is there a way to do a complete data set from an object in R?
>> I have a data set with more than 3000 columns.
>>
>> The subsetting is ok but it could be dangerous if you are using other
>> factors to do some analysis as you need to specify the levels for all
>> your factors again.
>>
>> Best,
>>
>> Manuel
>>
>> On 24/04/2011 08:30 a.m., Gustavo Carvalho wrote:
>>> pa2<- subset(pa, influencia=="AP")
>>> pa2$influencia<- factor(pa2$influencia)
>>> levels(pa2$influencia)
>>>
>>> On Sun, Apr 24, 2011 at 11:24 AM, Manuel Spínola   
>>> wrote:
>>>> Thank you very much for your response, Christian, Roman, and Sarah.
>>>>
>>>> Sarah,
>>>>
>>>> I am trying your suggestion but I cannot see the levels:
>>>>
>>>>>   pa2 = factor(subset(pa, influencia=="AP")$influencia)
>>>>>   levels(pa2$influencia)
>>>> Error in pa2$influencia : $ operator is invalid for atomic vectors
>>>>
>>>> Best,
>>>>
>>>> Manuel
>>>>
>>>>
>>>>
>>>> On 24/04/2011 07:51 a.m., Sarah Goslee wrote:
>>>>> By default, read.csv() turns character variables into factors, using all 
>>>>> the
>>>>> unique values as the levels.
>>>>>
>>>>> subset() retains those levels by default, as they are a vital element of 
>>>>> the
>>>>> data. If you are studying some attribute of men and women, say height,
>>>>> even if you are only looking at the heights for women it's important to 
>>>>> remember
>>>>> that men still exist.
>>>>>
>>>>> If you don't want influencia to be a factor, you can change that in the 
>>>>> import
>>>>> stringsAsFactors=FALSE.
>>>>>
>>>>> If you do want influencia to be a factor, but want the unused levels to be
>>>>> removed, you can use factor() to do that.
>>>>>
>>>>>> testdata<- data.frame(group=c("A", "B", "C", "A", "B", "C"), value=1:6)
>>>>>> testdata
>>>>>  group value
>>>>> 1 A 1
>>>>> 2 B 2
>>>>> 3 C 3
>>>>> 4 A 4
>>>>> 5 B 5
>>>>> 6 C 6
>>>>>> str(testdata)
>>>>> 'data.frame': 6 obs. of  2 variables:
>>>>> $ group: Factor w/ 3 levels "A","B","C": 1 2 3 1 2 3
>>>>> $ value: int  1 2 3 4 5 6
>>>>>> subset(testdata, group=="A")
>>>>>  group value
>>>>> 1 A 1
>>>>> 4 A 4
>>>>>> subset(testdata, group=="A")$group
>>>>> [1] A A
>>>>> Levels: A B C
>>>>>> ?subset
>>>>>> factor(subset(testdata, group=="A")$group)
>>>>> [1] A A
>>>>> Levels: A
>>>>>
>>>>> Sarah
>>>>>
>>>>> On Sun, Apr

Re: [R-sig-eco] subsetting data in R

2011-04-24 Thread Manuel Spínola
Thank you for all the responses.

Is there a way to do a complete data set from an object in R?
I have a data set with more than 3000 columns.

The subsetting is ok but it could be dangerous if you are using other 
factors to do some analysis as you need to specify the levels for all 
your factors again.

Best,

Manuel

On 24/04/2011 08:30 a.m., Gustavo Carvalho wrote:
> pa2<- subset(pa, influencia=="AP")
> pa2$influencia<- factor(pa2$influencia)
> levels(pa2$influencia)
>
> On Sun, Apr 24, 2011 at 11:24 AM, Manuel Spínola  
> wrote:
>> Thank you very much for your response, Christian, Roman, and Sarah.
>>
>> Sarah,
>>
>> I am trying your suggestion but I cannot see the levels:
>>
>>   >  pa2 = factor(subset(pa, influencia=="AP")$influencia)
>>   >  levels(pa2$influencia)
>> Error in pa2$influencia : $ operator is invalid for atomic vectors
>>
>> Best,
>>
>> Manuel
>>
>>
>>
>> On 24/04/2011 07:51 a.m., Sarah Goslee wrote:
>>> By default, read.csv() turns character variables into factors, using all the
>>> unique values as the levels.
>>>
>>> subset() retains those levels by default, as they are a vital element of the
>>> data. If you are studying some attribute of men and women, say height,
>>> even if you are only looking at the heights for women it's important to 
>>> remember
>>> that men still exist.
>>>
>>> If you don't want influencia to be a factor, you can change that in the 
>>> import
>>> stringsAsFactors=FALSE.
>>>
>>> If you do want influencia to be a factor, but want the unused levels to be
>>> removed, you can use factor() to do that.
>>>
 testdata<- data.frame(group=c("A", "B", "C", "A", "B", "C"), value=1:6)
 testdata
>>> group value
>>> 1 A 1
>>> 2 B 2
>>> 3 C 3
>>> 4 A 4
>>> 5 B 5
>>> 6 C 6
 str(testdata)
>>> 'data.frame': 6 obs. of  2 variables:
>>>$ group: Factor w/ 3 levels "A","B","C": 1 2 3 1 2 3
>>>$ value: int  1 2 3 4 5 6
 subset(testdata, group=="A")
>>> group value
>>> 1 A 1
>>> 4 A 4
 subset(testdata, group=="A")$group
>>> [1] A A
>>> Levels: A B C
 ?subset
 factor(subset(testdata, group=="A")$group)
>>> [1] A A
>>> Levels: A
>>>
>>> Sarah
>>>
>>> On Sun, Apr 24, 2011 at 9:04 AM, Manuel Spínola
>>> wrote:
 Dear list members,

 I have a question regarding too subsetting a data set in R.

 I created an object for my data:

>pa = read.csv("espec_indic.csv", header = T, sep=",", check.names = F)

>levels(pa$influencia)
 [1] "AID" "AII" "AP"

 The object has 3 levels for influencia (AP, AID, AII)

 Now I subset only observations with influencia = "AID"

>pa2 = subset(pa, influencia=="AID")

 but if I ask for the levels of influencia still show me the 3 levels,
 AP, AID, AII.

>levels(pa2$influencia)
 [1] "AID" "AII" "AP"

 Why is that?

 I was thinking that I was creating a new data frame with only AID as a
 level for influencia.

 How can I make a complete new object with only the observations for
 "AID" and that the only level for influencia is indeed "AID"?

 Best,

 Manuel


>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.ac.cr
>> mspinol...@gmail.com
>> Teléfono: (506) 2277-3598
>> Fax: (506) 2237-7036
>> Personal website: Lobito de río
>> 
>> Institutional website: ICOMVIS
>>
>> [[alternative HTML version deleted]]
>>
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 

Institutional website: ICOMVIS 

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] subsetting data in R

2011-04-24 Thread Manuel Spínola
Thank you very much Gustavo.

That works.

Manuel

On 24/04/2011 08:30 a.m., Gustavo Carvalho wrote:
> pa2<- subset(pa, influencia=="AP")
> pa2$influencia<- factor(pa2$influencia)
> levels(pa2$influencia)
>
> On Sun, Apr 24, 2011 at 11:24 AM, Manuel Spínola  
> wrote:
>> Thank you very much for your response, Christian, Roman, and Sarah.
>>
>> Sarah,
>>
>> I am trying your suggestion but I cannot see the levels:
>>
>>   >  pa2 = factor(subset(pa, influencia=="AP")$influencia)
>>   >  levels(pa2$influencia)
>> Error in pa2$influencia : $ operator is invalid for atomic vectors
>>
>> Best,
>>
>> Manuel
>>
>>
>>
>> On 24/04/2011 07:51 a.m., Sarah Goslee wrote:
>>> By default, read.csv() turns character variables into factors, using all the
>>> unique values as the levels.
>>>
>>> subset() retains those levels by default, as they are a vital element of the
>>> data. If you are studying some attribute of men and women, say height,
>>> even if you are only looking at the heights for women it's important to 
>>> remember
>>> that men still exist.
>>>
>>> If you don't want influencia to be a factor, you can change that in the 
>>> import
>>> stringsAsFactors=FALSE.
>>>
>>> If you do want influencia to be a factor, but want the unused levels to be
>>> removed, you can use factor() to do that.
>>>
 testdata<- data.frame(group=c("A", "B", "C", "A", "B", "C"), value=1:6)
 testdata
>>> group value
>>> 1 A 1
>>> 2 B 2
>>> 3 C 3
>>> 4 A 4
>>> 5 B 5
>>> 6 C 6
 str(testdata)
>>> 'data.frame': 6 obs. of  2 variables:
>>>$ group: Factor w/ 3 levels "A","B","C": 1 2 3 1 2 3
>>>$ value: int  1 2 3 4 5 6
 subset(testdata, group=="A")
>>> group value
>>> 1 A 1
>>> 4 A 4
 subset(testdata, group=="A")$group
>>> [1] A A
>>> Levels: A B C
 ?subset
 factor(subset(testdata, group=="A")$group)
>>> [1] A A
>>> Levels: A
>>>
>>> Sarah
>>>
>>> On Sun, Apr 24, 2011 at 9:04 AM, Manuel Spínola
>>> wrote:
 Dear list members,

 I have a question regarding too subsetting a data set in R.

 I created an object for my data:

>pa = read.csv("espec_indic.csv", header = T, sep=",", check.names = F)

>levels(pa$influencia)
 [1] "AID" "AII" "AP"

 The object has 3 levels for influencia (AP, AID, AII)

 Now I subset only observations with influencia = "AID"

>pa2 = subset(pa, influencia=="AID")

 but if I ask for the levels of influencia still show me the 3 levels,
 AP, AID, AII.

>levels(pa2$influencia)
 [1] "AID" "AII" "AP"

 Why is that?

 I was thinking that I was creating a new data frame with only AID as a
 level for influencia.

 How can I make a complete new object with only the observations for
 "AID" and that the only level for influencia is indeed "AID"?

 Best,

 Manuel


>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.ac.cr
>> mspinol...@gmail.com
>> Teléfono: (506) 2277-3598
>> Fax: (506) 2237-7036
>> Personal website: Lobito de río
>> 
>> Institutional website: ICOMVIS
>>
>> [[alternative HTML version deleted]]
>>
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 

Institutional website: ICOMVIS 

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] subsetting data in R

2011-04-24 Thread Manuel Spínola
Thank you Christian.

Following your suggestion I got the following result,

 > pa2 = subset(pa, influencia=="AP")
 > pa2$influencia<-as.factor(pa2$influencia)
 > levels(pa$influencia)
[1] "AID" "AII" "AP"


On 24/04/2011 07:42 a.m., Christian Parker wrote:
> You are creating a new object, but the columns that are stored as factors are 
> not being 'refactored' so you are retaining the original list of levels. To 
> fix this you can use the factor function after you subset
>
> pa2 = subset(pa, influencia=="AID")
> pa2$influencia<-as.factor(pa2$influencia)
>
>
>
> On Apr 24, 2011, at 6:04 AM, Manuel Spínola  wrote:
>
>> Dear list members,
>>
>> I have a question regarding too subsetting a data set in R.
>>
>> I created an object for my data:
>>
>>> pa = read.csv("espec_indic.csv", header = T, sep=",", check.names = F)
>>> levels(pa$influencia)
>> [1] "AID" "AII" "AP"
>>
>> The object has 3 levels for influencia (AP, AID, AII)
>>
>> Now I subset only observations with influencia = "AID"
>>
>>> pa2 = subset(pa, influencia=="AID")
>> but if I ask for the levels of influencia still show me the 3 levels,
>> AP, AID, AII.
>>
>>> levels(pa2$influencia)
>> [1] "AID" "AII" "AP"
>>
>> Why is that?
>>
>> I was thinking that I was creating a new data frame with only AID as a
>> level for influencia.
>>
>> How can I make a complete new object with only the observations for
>> "AID" and that the only level for influencia is indeed "AID"?
>>
>> Best,
>>
>> Manuel
>>
>>
>>
>>
>> -- 
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.ac.cr
>> mspinol...@gmail.com
>> Teléfono: (506) 2277-3598
>> Fax: (506) 2237-7036
>> Personal website: Lobito de río
>> 
>> Institutional website: ICOMVIS
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 

Institutional website: ICOMVIS 

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] subsetting data in R

2011-04-24 Thread Manuel Spínola
Thank you very much for your response, Christian, Roman, and Sarah.

Sarah,

I am trying your suggestion but I cannot see the levels:

 > pa2 = factor(subset(pa, influencia=="AP")$influencia)
 > levels(pa2$influencia)
Error in pa2$influencia : $ operator is invalid for atomic vectors

Best,

Manuel



On 24/04/2011 07:51 a.m., Sarah Goslee wrote:
> By default, read.csv() turns character variables into factors, using all the
> unique values as the levels.
>
> subset() retains those levels by default, as they are a vital element of the
> data. If you are studying some attribute of men and women, say height,
> even if you are only looking at the heights for women it's important to 
> remember
> that men still exist.
>
> If you don't want influencia to be a factor, you can change that in the import
> stringsAsFactors=FALSE.
>
> If you do want influencia to be a factor, but want the unused levels to be
> removed, you can use factor() to do that.
>
>> testdata<- data.frame(group=c("A", "B", "C", "A", "B", "C"), value=1:6)
>> testdata
>group value
> 1 A 1
> 2 B 2
> 3 C 3
> 4 A 4
> 5 B 5
> 6 C 6
>> str(testdata)
> 'data.frame': 6 obs. of  2 variables:
>   $ group: Factor w/ 3 levels "A","B","C": 1 2 3 1 2 3
>   $ value: int  1 2 3 4 5 6
>> subset(testdata, group=="A")
>    group value
> 1 A 1
> 4 A 4
>> subset(testdata, group=="A")$group
> [1] A A
> Levels: A B C
>> ?subset
>> factor(subset(testdata, group=="A")$group)
> [1] A A
> Levels: A
>
> Sarah
>
> On Sun, Apr 24, 2011 at 9:04 AM, Manuel Spínola  wrote:
>> Dear list members,
>>
>> I have a question regarding too subsetting a data set in R.
>>
>> I created an object for my data:
>>
>>   >pa = read.csv("espec_indic.csv", header = T, sep=",", check.names = F)
>>
>>   >  levels(pa$influencia)
>> [1] "AID" "AII" "AP"
>>
>> The object has 3 levels for influencia (AP, AID, AII)
>>
>> Now I subset only observations with influencia = "AID"
>>
>>   >pa2 = subset(pa, influencia=="AID")
>>
>> but if I ask for the levels of influencia still show me the 3 levels,
>> AP, AID, AII.
>>
>>   >  levels(pa2$influencia)
>> [1] "AID" "AII" "AP"
>>
>> Why is that?
>>
>> I was thinking that I was creating a new data frame with only AID as a
>> level for influencia.
>>
>> How can I make a complete new object with only the observations for
>> "AID" and that the only level for influencia is indeed "AID"?
>>
>> Best,
>>
>> Manuel
>>
>>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
<https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] subsetting data in R

2011-04-24 Thread Manuel Spínola
Dear list members,

I have a question regarding too subsetting a data set in R.

I created an object for my data:

 >pa = read.csv("espec_indic.csv", header = T, sep=",", check.names = F)

 > levels(pa$influencia)
[1] "AID" "AII" "AP"

The object has 3 levels for influencia (AP, AID, AII)

Now I subset only observations with influencia = "AID"

 >pa2 = subset(pa, influencia=="AID")

but if I ask for the levels of influencia still show me the 3 levels, 
AP, AID, AII.

 > levels(pa2$influencia)
[1] "AID" "AII" "AP"

Why is that?

I was thinking that I was creating a new data frame with only AID as a 
level for influencia.

How can I make a complete new object with only the observations for 
"AID" and that the only level for influencia is indeed "AID"?

Best,

Manuel




-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
<https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Sites names with spaces in ordiplot

2011-04-01 Thread Manuel Spínola
Thank you very much Gavin.

I understand now.

Best,

Manuel

On 01/04/2011 05:29 a.m., Gavin Simpson wrote:
> On Fri, 2011-04-01 at 05:14 -0600, Manuel Spínola wrote:
>> Gavin and Jari, thank you very much.
>>
>> Actually, I am interested in both, sites and species.  I have 3000
>> species (tropical forest trees) and I am trying to read the txt file
>> with read.table.  I tried also read.delim, but I don't know how to
>> bring
>> the sites names in the plot.  I guess now I have the answer, using
>> text().
> I mentioned this in my last email - the one you are replying to. The
> issue is that R will check the species (variable) names on input and
> remove spaces, replacing them with a `.`. But you *can* control whether
> it does this or not using check.names = FALSE.
>
> For example. Here is a simple CSV file:
>
> ,"Spp 1","Spp 2","Spp 3"
> "Site 1",1,4,7
> "Site 2",2,5,8
> "Site 3",3,6,9
>
> with spaces in both the species and site names.
>
> We read it in via:
>
> dat<- read.csv("spp.csv", row.names = 1, check.names = FALSE)
> dat
>
> And it gives us:
>
> Spp 1 Spp 2 Spp 3
> Site 1 1 4 7
> Site 2 2 5 8
> Site 3 3 6 9
>
> So it *has* preserved the spaces in the species names and it hasn't
> touched the row names.
>
> We can ordinate this with out any problems:
>
> require(vegan)
> mod<- metaMDS(dat)
> plot(mod, type = "text")
>
> Ok, that is a pretty pointless plot but it works.
>
> Does that help?
>
> G
>
>> What happened if I have a txt file like this:
>>
>> siteAbarema adenophoraAbarema
>> macradenia
>> Abatia parvifloraAbelmoschus esculentusAbelmoschus moschatus
>> General Viejo
>> 1
>> 1
>> 1
>> 11
>> Rio Pacuar
>> 0
>> 0
>> 0
>>   00
>> Las Brisas
>> 0
>> 0
>> 0
>> 1
>>  1
>> San Pedro
>> 0
>> 0
>> 0
>> 1 1
>> Rio Convento   0
>> 0
>>
>> 0
>> 1 1
>>
>> What will be the way to keep blank spaces for sites and species.  I
>> know
>> that species will be unnecessary in this case  because I have too
>> many
>> and I cannot show them in the plot, but just to learn for another
>> time.
>>
>> Best,
>>
>> Manuel
>>
>>
>> On 01/04/2011 03:16 a.m., Gavin Simpson wrote:
>>> On Fri, 2011-04-01 at 07:01 +0300, Jari Oksanen wrote:
 On 31/03/11 23:18 PM, "Manuel Spínola"
>> wrote:
> Dear list members,
>
> I would like to include sites names with blank spaces in an
>> ordiplot for
> an nmds (in vegan).
> How I do that?
>
 Manuel,

 Like Gav wrote, R indeed is a bit patronizing and doesn't let you
>> to use
 dimension names with blank.
>>> It does. I made the species labels in my examples *not* have spaces
>> in
>>> them because Manuel said only his site names had spaces. The
>> following
>>> works just fine:
>>>
>>> require(vegan)
>>> set.seed(1)
>>> dat<- data.frame(matrix(runif(100), ncol = 10))
>>> names(dat)<- paste("Spp", 1:10)
>>> rownames(dat)<- paste("Site", 1:10)
>>> mod<- metaMDS(dat)
>>> plot(mod, type = "text")
>>>
R only wants to protect you from trouble.
>>> Indeed - it is a pain to look at `Spp 1` now, for example, as
>> everything
>>> needs to be quoted:
>>>
>>> R>   dat$`Spp 1`
>>>[1] 0.26550866 0.37212390 0.57285336 0.90820779 0.20168193
>> 0.89838968
>>>[7] 0.94467527 0.66079779 0.62911404 0.06178627
>>>
>>> One issue that might catch people out is that R doesn't let you read
>>> data in with spaces in the colnames (unless read.table()'s
>> check.names =
>>> FALSE is set) - spaces get replaced with `.`.
>>>
>>> However, the only constraint on rownames is that they be non-missing
>> and
>>> non-duplicated. Both sets of names need to be syntactically valid
>> but
>>> spaces are fine.
>>>
>>> Hence one can always change the row/colnames to suit just before
>>> plotting so one doesn't need to resort to extra plotting calls to
>>> achieve the desired result. That said, one usually will need extra
>> calls
>>> to ordiplot functions as ordinations are complex beasts to plot so
>>> drawing the points with custom text labels is no real hardship
>> either.
>>> Either approach works.
>>>
>>> G
>>>
 However, vegan lets you use any names in text() function for
>> metaMDS: just
 list those names as a vector of quoted text in 'labels' argument to
 text.metaMDS(). The names given in 'labels' can have blanks, or
>> even be al
 blanks as long as they are quoted. The length of the 'labels' must
>> match the
 number of items plotted.

 All vegan text() functions for ordination plots should have the
>> 'labels'
 argument. I cannot guarantee that all of them have, but you can
>> always
 report missing cases to us. The text() for metaMDS() certainly has
>> 'labels'
 as you can see if you read t

Re: [R-sig-eco] Sites names with spaces in ordiplot

2011-04-01 Thread Manuel Spínola
Gavin and Jari, thank you very much.

Actually, I am interested in both, sites and species.  I have 3000 
species (tropical forest trees) and I am trying to read the txt file 
with read.table.  I tried also read.delim, but I don't know how to bring 
the sites names in the plot.  I guess now I have the answer, using text().

What happened if I have a txt file like this:

siteAbarema adenophoraAbarema macradenia
Abatia parvifloraAbelmoschus esculentusAbelmoschus moschatus
General Viejo   1   
11   
11
Rio Pacuar0 
   00   
 00
Las Brisas  
0  0 
0  1 
1
San Pedro 0  
0 0  
1 1
Rio Convento   0  0 
 0  
1 1

What will be the way to keep blank spaces for sites and species.  I know 
that species will be unnecessary in this case  because I have too many 
and I cannot show them in the plot, but just to learn for another time.

Best,

Manuel


On 01/04/2011 03:16 a.m., Gavin Simpson wrote:
> On Fri, 2011-04-01 at 07:01 +0300, Jari Oksanen wrote:
>> On 31/03/11 23:18 PM, "Manuel Spínola"  wrote:
>>
>>> Dear list members,
>>>
>>> I would like to include sites names with blank spaces in an ordiplot for
>>> an nmds (in vegan).
>>> How I do that?
>>>
>> Manuel,
>>
>> Like Gav wrote, R indeed is a bit patronizing and doesn't let you to use
>> dimension names with blank.
> It does. I made the species labels in my examples *not* have spaces in
> them because Manuel said only his site names had spaces. The following
> works just fine:
>
> require(vegan)
> set.seed(1)
> dat<- data.frame(matrix(runif(100), ncol = 10))
> names(dat)<- paste("Spp", 1:10)
> rownames(dat)<- paste("Site", 1:10)
> mod<- metaMDS(dat)
> plot(mod, type = "text")
>
>>   R only wants to protect you from trouble.
> Indeed - it is a pain to look at `Spp 1` now, for example, as everything
> needs to be quoted:
>
> R>  dat$`Spp 1`
>   [1] 0.26550866 0.37212390 0.57285336 0.90820779 0.20168193 0.89838968
>   [7] 0.94467527 0.66079779 0.62911404 0.06178627
>
> One issue that might catch people out is that R doesn't let you read
> data in with spaces in the colnames (unless read.table()'s check.names =
> FALSE is set) - spaces get replaced with `.`.
>
> However, the only constraint on rownames is that they be non-missing and
> non-duplicated. Both sets of names need to be syntactically valid but
> spaces are fine.
>
> Hence one can always change the row/colnames to suit just before
> plotting so one doesn't need to resort to extra plotting calls to
> achieve the desired result. That said, one usually will need extra calls
> to ordiplot functions as ordinations are complex beasts to plot so
> drawing the points with custom text labels is no real hardship either.
>
> Either approach works.
>
> G
>
>> However, vegan lets you use any names in text() function for metaMDS: just
>> list those names as a vector of quoted text in 'labels' argument to
>> text.metaMDS(). The names given in 'labels' can have blanks, or even be al
>> blanks as long as they are quoted. The length of the 'labels' must match the
>> number of items plotted.
>>
>> All vegan text() functions for ordination plots should have the 'labels'
>> argument. I cannot guarantee that all of them have, but you can always
>> report missing cases to us. The text() for metaMDS() certainly has 'labels'
>> as you can see if you read the help page ?metaMDS (which may not be a bad
>> idea).
>>
>> Cheers, Jari Oksanen
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 

Institutional website: ICOMVIS 

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project

[R-sig-eco] Sites names with spaces in ordiplot

2011-03-31 Thread Manuel Spínola
Dear list members,

I would like to include sites names with blank spaces in an ordiplot for 
an nmds (in vegan).
How I do that?

Best,

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
<https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Error with "raup" distance, in metaMDS

2011-03-29 Thread Manuel Spínola
Thank you very much Brian.

Best,

Manuel

On 28/03/2011 06:07 a.m., Brian Inouye wrote:
> There are other dissimilarity metrics that could also be used, each 
> with different assumptions of course.
> Raup-Crick is a reasonable choice of distance metric, but I'm not sure 
> if the current version of vegdist() has been updated to reflect 
> discussion in Chase et al 2011 in Ecosphere 
> (http://www.esajournals.org/doi/abs/10.1890/ES10-00117.1).
>
> -Brian
>
> On 3/28/2011 12:00 PM,"Manuel Spínola"  wrote:
>> Is the Raup--Crick dissimilarity metric the only option for a
>> presence/absence data in "vegdist" or using binary = T could I use any
>> other dissimilarity metric?
>>
>> Best,
>>
>> Manuel
>> 
>> On 27/03/2011 09:07 a.m., Jari Oksanen wrote:
>>> Manuel,
>>>
>>> As I read it, the error message comes from isoMDS() that does not 
>>> accept
>>> zero distances, and you have decided to ignore this (by setting 
>>> zerodist =
>>> "ignore"). Either you or isoMDS must give up, and I think it is 
>>> easier for
>>> you: try setting 'zerodist = "add"', and confess that isoMDS() wins 
>>> your
>>> dispute.
>>>
>>> Another message you got is from vegdist() which only tells you that 
>>> empty
>>> species (= that do not occur in your data) will influence your data. 
>>> That is
>>> only informational, and not an error.
>>>
>>> Cheers, Jari Oksanen
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
<https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] [POSIBLE SPAM] Re: Error with "raup" distance in metaMDS

2011-03-27 Thread Manuel Spínola
Thank you very much Jari.

Is the Raup--Crick dissimilarity metric the only option for a 
presence/absence data in "vegdist" or using binary = T could I use any 
other dissimilarity metric?

Best,

Manuel

On 27/03/2011 09:07 a.m., Jari Oksanen wrote:
> On 26/03/11 17:35 PM, "Manuel Spínola"  wrote:
>
>> Dear list members,
>>
>> I got an error message working with Raup--Crick distance in metaMDS.
>>
>>> flora.mds = metaMDS(indicadora, distance = "raup", trace = FALSE, zerodist
>> = "ignore")
>> Error in isoMDS(dist, k = k, trace = isotrace) :
>>zero or negative distance between objects 1 and 2
>> In addition: Warning message:
>> In distfun(comm, method = distance, ...) :
>>data have empty species which influence the results im method raup
>>
> Manuel,
>
> As I read it, the error message comes from isoMDS() that does not accept
> zero distances, and you have decided to ignore this (by setting zerodist =
> "ignore"). Either you or isoMDS must give up, and I think it is easier for
> you: try setting 'zerodist = "add"', and confess that isoMDS() wins your
> dispute.
>
> Another message you got is from vegdist() which only tells you that empty
> species (= that do not occur in your data) will influence your data. That is
> only informational, and not an error.
>
> Cheers, Jari Oksanen
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
<https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Error with "raup" distance in metaMDS

2011-03-26 Thread Manuel Spínola
Dear list members,

I got an error message working with Raup–Crick distance in metaMDS.

> flora.mds = metaMDS(indicadora, distance = "raup", trace = FALSE, zerodist
= "ignore")
Error in isoMDS(dist, k = k, trace = isotrace) :
  zero or negative distance between objects 1 and 2
In addition: Warning message:
In distfun(comm, method = distance, ...) :
  data have empty species which influence the results im method raup

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Species richness in R

2011-02-11 Thread Manuel Spínola
Dera list members,

I am trying to estimate species richness for several single sites and for
the collection of all sites.  I am looking at the specpool and estimateR at
the vegan package.

Is there any other alternatives in R?

How these estimates are influenced by diffrent sampling effort at each site
(i.e., the number of visits to the sites varies)?

I am trying to get also an estimate of the detection probability, but it
seems that this parameter is not included in those functions.

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] se and confidence limits for predictors from a model output not obtained in R

2010-10-13 Thread Manuel Spínola
  Dear list members,

Is there a way to obtain the confidence limits for a model that was not 
generated in R to obtain a plot of the model?  I have the output from a 
logistic model: coefficients, se and varcov matrix (all in logit).
I am thinking in a way to use the function predict to get the se (and 
the  confidence limits) for different predictors in the model to obtain 
a plot for each predictor like the effect package does.
Thank you very much in advance.
Best,

Manuel



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
<https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] CI for mixed models with lme

2010-09-25 Thread Manuel Spínola

 Dear list members,

I am fitting 2 linear mixed model with function lme and I cannot get the 
CI for "modelo2" with function "intervlas" (below are the output from 
the 2 models).

Any clue why?  Thank you very much in advance.  Manuel.

> intervals(modelo1)$fixed
lower  est. upper
(Intercept)  29.21725  42.85153  56.48581
tempo   -24.41173 -19.74592 -15.08011
attr(,"label")
[1] "Fixed effects:"

> intervals(modelo2)$fixed
Error en intervals.lme(modelo2) :
  Cannot get confidence intervals on var-cov components: Non-positive 
definite approximate variance-covariance



modelo1 = lme(ipa ~ tempo, data=ipa, random = ~1 | localidad)
> summary(modelo1)
Linear mixed-effects model fit by REML
 Data: ipa
   AIC  BIClogLik
  2062.101 2075.172 -1027.050

Random effects:
 Formula: ~1 | localidad
(Intercept) Residual
StdDev:44.61678 36.95279

Fixed effects: ipa ~ tempo
Value Std.Error  DF   t-value p-value
(Intercept)  42.85153  6.898734 146  6.211507   0
tempo   -19.74592  2.360827 146 -8.363982   0
 Correlation:
  (Intr)
tempo 0

Standardized Within-Group Residuals:
Min  Q1 Med  Q3 Max
-2.50376489 -0.45760686 -0.07812592  0.39097892  5.25554463

Number of Observations: 196
Number of Groups: 49


modelo2 = lme(ipa ~ tempo, random = ~1 | tempo/localidad, data=ipa)
> summary(modelo2)
Linear mixed-effects model fit by REML
 Data: ipa
   AIC BIClogLik
  2144.981 2161.32 -1067.490

Random effects:
 Formula: ~1 | tempo
(Intercept)
StdDev:5.540235

 Formula: ~1 | localidad %in% tempo
(Intercept) Residual
StdDev: 54.1832 19.60406

Fixed effects: ipa ~ tempo
Value Std.Error  DF   t-value p-value
(Intercept)  42.85153  4.961152 192  8.637415   0.000
tempo   -19.74592  4.437389   2 -4.449895   0.047
 Correlation:
  (Intr)
tempo 0

Standardized Within-Group Residuals:
Min  Q1 Med  Q3 Max
-0.42528137 -0.17487600 -0.08655534  0.06944999  2.05895746

Number of Observations: 196
Number of Groups:
   tempo localidad %in% tempo
       4  196

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Logistic regression plot

2010-08-17 Thread Manuel Spínola

 Dear List members,

How can I plot in R the result from a logistic regression model with 3 
continuous explanatory variable when I only have the model output 
(coefficients and SE) and the explanatory variable range values.  I 
don't have the var-cov matrix.

I will like to make 3 plots, one for each variable in the model.
Thank you very much in advance.
Best,

Manuel

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Transforming logits to probabilities

2010-07-08 Thread Manuel Spínola

Dear list members,

I am using function invlogit from the "arm" package to get the 
difference in probabilities for a explanatory factor from the model 
below (I am working with factor "iluminacion").


> invlogit(-0.4241 - 0.4804 * 0) - invlogit(-0.4241 - 0.4804 * 1) # 
difference in probability for iluminacion

[1] 0.1074094

How can I transform the standard error of the difference from logit to 
probability?


The standard error in logits is 0.2416 (taken from the model below).

Best,

Manuel


> summary(mod6)

Call:
glm(formula = condicion ~ iluminacion + animales + cielo.raso +
piso + paredes, family = binomial, data = reglog)

Deviance Residuals:
Min   1Q   Median   3Q  Max
-1.2527  -1.0034  -0.8276   1.2208   1.6981

Coefficients:
 Estimate Std. Error z value Pr(>|z|)
(Intercept)   -0.4241 0.2833  -1.497   0.1343
iluminacion[T.1]  -0.4804 0.2416  -1.988   0.0468 *
animales[T.1]  0.4613 0.2385   1.934   0.0531 .
cielo.raso[T.1]   -0.1386 0.2840  -0.488   0.6254
piso[T.1]  0.1380 0.2934   0.470   0.6382
paredes[T.1]  -0.1289 0.3012  -0.428   0.6687
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 433.04  on 319  degrees of freedom
Residual deviance: 424.30  on 314  degrees of freedom
  (25 observations deleted due to missingness)
AIC: 436.3

Number of Fisher Scoring iterations: 4


--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Function predict

2010-07-07 Thread Manuel Spínola

Dear list members,

I am fitting a logistic regression with 5 explanatory factors (which I 
converted to factors):


mod6 = glm(condicion ~ iluminacion + animales + cielo.raso + piso + 
paredes, family=binomial, data=reglog)


I want to obtain the predicted probabilities and the se using the 
function "predict" for some combination of the factors.


iluminacion = 1
animales = 0
cielo.raso = 0
piso = 0
paredes = 0

newdata1 = data.frame(iluminacion, animales, cielo.raso, piso, paredes)

newdata1$cond = predict(mod6, newdata = newdata1, type="response")

> newdata1$cond = predict(mod6, newdata = newdata1, type="response")
Aviso en model.frame.default(Terms, newdata, na.action = na.action, xlev 
= object$xlevels) :

 variable 'iluminacion' is not a factor
Aviso en model.frame.default(Terms, newdata, na.action = na.action, xlev 
= object$xlevels) :

 variable 'animales' is not a factor
Aviso en model.frame.default(Terms, newdata, na.action = na.action, xlev 
= object$xlevels) :

 variable 'cielo.raso' is not a factor
Aviso en model.frame.default(Terms, newdata, na.action = na.action, xlev 
= object$xlevels) :

 variable 'piso' is not a factor
Aviso en model.frame.default(Terms, newdata, na.action = na.action, xlev 
= object$xlevels) :

 variable 'paredes' is not a factor
Error: variables 'iluminacion', 'animales', 'cielo.raso', 'piso', 
'paredes' were specified with different types from the fit


I don't understand what is wrong.
Any help will be appreciated.

Best,

Manuel

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Effect size for factors in lm and glm

2010-07-06 Thread Manuel Spínola

Dear list members,

I really like the idea of presenting the effect size (point and interval 
estimation) instead of P values, but I am wondering if there is any 
package in R that calculate effect size from lm and glm when the 
explanatory variables are factors.
I know that there is a package called "effects"  but when working with 
factors the calculation and display is not for the effect size (the 
difference between 2 levels of a factor a its confidence interval).
I am thinking in a calculation that take into consideration the 
variance-covariance matrix.

Any hint on this.
Thank you very much in advance.
Best,

Manuel

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Modeling when all variables are categoricalb

2010-07-04 Thread Manuel Spínola

Dear list memebers,

I am modeling a binary response variable and 6 explanatory factors (all 
my variables, response and explanatory, are categoricals).
I fitted a logistic regression but when I tried to use the CVbinary 
(DAAG package) function to measure the predictive accuracy of the 
regression model with a binary response I got the following result:


> mod1 = glm(condicion ~ ., family=binomial, data=reglog)
> CVbinary(mod1)

Fold:  2 1 7 9 6 4 10 5 8 3
Internal estimate of accuracy = NA
Cross-validation estimate of accuracy = NA

Am I getting this result because I am working with a saturated model?
How is the way to model this type of data (1 categorical response 
variable and 6 explanatory factors)?
I also used classification trees for the data but the error is bigger 
after the first split.


Best,

Manuel

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Multiple proportions analysis in R

2010-05-18 Thread Manuel Spínola

Dear list members,

The following question is not entirely an R question but I am looking 
how to analyze the below data set in R (I know that sample size is very 
low):


I have a data set corresponding to 12 nests with (20 to 30 eggs each).  
The number of eggs per nest varies.
In each nest I assessed the stage of egg development, location (zone), 
humidity and temperature.


nest  stage0 stage2 stage3 stage4   zone   humidity temp

112   800   a4.35  34.5
2 0   10   214  a5.56   32.4
3 0   14  0 12  a6.57   33.7
4 0   12 153b   7.0833.4
.
.
12  06   20   0  c   5.07   34.5

I have multiple proportions (one for each stage) in each nest but they 
are not independent. 
I want to assess the effect of zone, humidity and temp on the proportion 
of different stages at each nest.

Is this a case for a multinomial model?
How is a simple way to analyze this data set?
Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Changing the reference level of a factor

2010-05-18 Thread Manuel Spínola

Dear list members,

I am trying to change the reference level of a factor but when I run a 
model with the lm function the new order it does not taking place (I 
still have the old order of the levels).


> relevel(nidprop$treatment, ref="c", data=nidprop)
[1] a a a a b b b b c c c c
Levels: c a b

> modelo1 = lm(hight ~ treatment, data = nidprop)

> summary(modelo1)

Call:
lm(formula = hight ~ treatment, data = nidprop)

Residuals:
   Min  1Q  Median  3Q Max
-1.6052 -1.0626 -0.0950  0.9228  3.0768

Coefficients:
  Estimate Std. Error t value Pr(>|t|)  
(Intercept) 37.9140 0.7368  51.461 1.98e-12 ***
treatment[T.b]  -0.2298 1.0419  -0.221   0.8304  
treatment[T.c]  -3.1133 1.0419  -2.988   0.0153 *

---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.474 on 9 degrees of freedom
Multiple R-squared: 0.552,  Adjusted R-squared: 0.4525
F-statistic: 5.545 on 2 and 9 DF,  p-value: 0.02696


Any idea why?

Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Zero-truncated Poisson model in R

2010-05-16 Thread Manuel Spínola

Dear list members,

Is there any function  to do zero-truncated poisson or zero-truncated 
negative binomail in R?

Thank you very much in advance.
Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] repeated measures design in R

2010-02-10 Thread Manuel Spínola

Dear list members,

I am analyzing a repeated measure design with the nlme package to assess 
the disease rate in 48 counties (localidad).  The disease rate was 
measured in 4 consecutive years.  The first 20 observations of my data 
set looks like:


> ipa
 localidad tiempoipa
1 15.MILLAS  1 123.40
2 23.MILLAS  1 185.40
3 24.MILLAS  1  21.31
4 25.MILLAS  1   0.00
5 26.MILLAS  1  59.11
6 28.MILLAS  1  10.28
7  4.MILLAS  1 118.69
8  7.MILLAS  1  17.09
9  AGRODISA  1  59.49
10  ASELICA  1  50.98
11BALTIMORE  1  25.10
12 BANANITA  1  19.30
13  BANASOL  1   0.00
14 BARBILLA  1  27.33
15BATAN  1  48.58
16   B.LINE  1  57.97
17   BOSTON  1 101.32
18  BRISTOL  1  47.62
19  COLONIA.PURISCALEÑA  1  22.22
20   CORINA  1  22.22


I tried these models:


# Pooled data

modelo1 = glm(ipa ~ tiempo, family=gaussian(link=identity), data=ipa)
summary(modelo1)

# Parallel slopes

modelo2 = glm(ipa ~ tiempo + localidad, family=gaussian(link=identity), 
data=ipa)

summary(modelo2)

# Random intercept (el intercepto cambia para cada localidad)

modelo3 = lme(ipa ~ tiempo, random = ~ 1 | localidad, data=ipa)
summary(modelo3)

# Random intercept and slope

modelo4 = lme(ipa ~ tiempo, random =  ~ tiempo | localidad, data=ipa)
summary(modelo4)

# Autocorrelation

modelo6 = lme(ipa ~ tiempo, random =  ~ 1 | localidad, correlation = 
corCAR1(form = ~ tiempo | localidad), data=ipa)

summary(modelo6)


The model for Random intercept and slope gave me this error:

> modelo4 = lme(ipa ~ tiempo, random =  ~ tiempo | localidad, data=ipa)
Error en lme.formula(ipa ~ tiempo, random = ~tiempo | localidad, data = 
ipa) :

 nlminb problem, convergence error code = 1
 message = iteration limit reached without convergence (9)

Do you know why the model (modelo4) has problems?

Also, is this the way to analyze a repeated measure design in R?

The counties (localidad) are all the county that I am interested, is 
that still random?


Thank you very much in advance.

Best,

Manuel Spínola






--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] multiple regression

2010-02-08 Thread Manuel Spínola

Dear list members,

There are also other approaches to estimate species richness using 
capture-recapture models and occupancy models which can take into 
account detection probability.
See softwares SPECRICH, SPECRICH2 and PRESENCE at the Patuxet web site: 
http://www.mbr-pwrc.usgs.gov/software.html


Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036




Peter Solymos wrote:

Dear List,

Thierry's suggestion, to use Binomial(p, N) for modelling species
richness, assumes that the probability of finding a new species (p)
depends e.g. on covaiates (logit(p)=X%*%beta), while different species
share the same probability to be encountered (N independent? trials --
as Alain noted). Because ecological communities rarely have uniform
species-abundance distribution, and species specific probabilities
will probably differ among sites due to different responses to
environmental factors, the Binomial approximation has limited
applicability. And this can be true even for the Poisson. So it turns
out that modeling marginal statistics (total abundance/richness) of
the community matrix requires modeling the communities first...

By the way, Nathan wrote me off list, that he used log transformed
richness, which is the traditional species-area way of handling
richness. He was more interested in variance components, but this
diverged conversation also brought up some interesting views.

Cheers,

Peter



On Mon, Feb 8, 2010 at 6:12 AM, ONKELINX, Thierry
 wrote:
  

Dear Gavin,

For many taxonomical groups to total number of species is rather low. Ecologist 
can either use a fixed total number of species or use some expert knowledge to 
get the total number of species, taking only large scale effect into account. 
E.g. freshwater fish not entering seawater, plant species not occuring above a 
given altitude, ...

The number of absent species is then the total number minus the number of 
present species.

As long as the number of present species is much smaller than the total number 
of species, a Poisson distribution seems a reasonable simplification. But what 
if you are studying a small taxonomical group? Let's assume a group with 10 
species and frequently 8 or 9 of them are present. Can assume that the species 
richness follows a Poisson distribution in that case?

Best regards,

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
thierry.onkel...@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than 
asking him to perform a post-mortem examination: he may be able to say what the 
experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure 
that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-Oorspronkelijk bericht-
Van: Gavin Simpson [mailto:gavin.simp...@ucl.ac.uk]
Verzonden: maandag 8 februari 2010 11:14
Aan: ONKELINX, Thierry
CC: Peter Solymos; Nathan Lemoine
Onderwerp: Re: [R-sig-eco] multiple regression

On Mon, 2010-02-08 at 11:02 +0100, ONKELINX, Thierry wrote:


Peter,

I would think that the species richness is binomial distributed. Since
there is a maximum number of species that can be present. Therefore I
would model it like

glm(cbind(number.present, number.absent) ~ covariates, family =
binomial)
  

Hi Thierry,

How would one estimate number.absent? To my mind, that sounds some what 
Rumsfeldian...

G



HTH,

Thierry

--
--
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek team Biometrie & Kwaliteitszorg
Gaverstraat 4 9500 Geraardsbergen Belgium

Research Institute for Nature and Forest team Biometrics & Quality
Assurance Gaverstraat 4 9500 Geraardsbergen Belgium

tel. + 32 54/436 185
thierry.onkel...@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than 
asking him to perform a post-mortem examination: he may be able to say what the 
experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure 
that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-Oorspronkelijk bericht-
Van: r-sig-ecology-boun...@r-project.org
[mailto:r-sig-ecology-boun...@r-project.org] Namens Peter Sol

[R-sig-eco] Repeated measures model in R

2009-09-15 Thread Manuel Spínola

Dear list members,

I would like to run a repeated measure model in R and I would like to 
have your advice on how to parameterize the model and which package and 
function should I use..


I have:

Disease rate (number of cases x 1000 people): the response variable
County (it would be the subject)
Year: from 2002 to 2007

My data set is unbalanced (the counties do not have information for all 
the years).

Thank you very much in advance.
Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Statistics applied to Geography using R

2009-07-04 Thread Manuel Spínola

Thank you very much Dr. Oksanen,

I was thinking in a very general sense because the idea is to cover the 
topic for undergraduate course, covering from regression to cluster 
analysis and also some geostatistics.  The idea is to show those 
analysis using geographic data.

Best,

Manuel


Jari Oksanen wrote:

Manuel, It would be very useful to know what you mean with 'geography'. 
Ideological and cultural aspects in regional transformation or periglacial 
processes? Geography is one of the most variable fields of science, and 
sometimes people have trouble in defining what is geography (indeed, I had a 
book exam on that subject when studying geography). One thing is clear: 
geostatistics is not equal to geography. Biogeography and palaeoecology may be 
- depends who you ask. A bit more specific question could perhaps get 
informative answers.

Cheers, Jari Oksanen 
-Original Message-----

From: Manuel Spínola
Sent:  02.07.2009, 23:17 
To: r-sig-ecology@r-project.org

Subject: [R-sig-eco] Statistics applied to  Geography using R

Dear list members,

Do you know any references for statistics applied to geography that are 
in some way related to R?
I think it will be ok also for references that do not use R but it will 
be easy to use through R.

Thank you very much in advance.
Best,

Manuel Spínola

  



--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Statistics applied to Geography using R

2009-07-02 Thread Manuel Spínola

Dear list members,

Do you know any references for statistics applied to geography that are 
in some way related to R?
I think it will be ok also for references that do not use R but it will 
be easy to use through R.

Thank you very much in advance.
Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Confidence intervals for predicted probabilities in logistic regression

2009-06-23 Thread Manuel Spínola

Dear list members,

I am fitting a logistic regression and I want to calculate the predicted 
probabilities of a response ("positive" and "negative") for a model with 
one categorical predictor (2 levels, "yes" and "no").


oso.3 = glm(response ~ school, data=osologistic, 
family=binomial(link="logit"))


For the reference level (the intercept, level "no") the point estimate is:,

> plogis(coef(oso.3)[1] + coef(oso.3)[2]*0)
(Intercept)
 0.13

To calculate the confidence interval (lower and upper limit) I am using 
the formula: beta0+beta1*x-1.96*se(beta0+beta1*x) and 
beta0+beta1*x+1.96*se(beta0+beta1*x), using the variance and covariance 
to calculate the standard error:


> errore.no = sqrt(1.14 + 1.73*02 + 2*-1.14*0)

> plogis(coef(oso.3)[1] + coef(oso.3)[2]*0-1.96*errore.no)
(Intercept)
0.017

> plogis(coef(oso.3)[1] + coef(oso.3)[2]*0+1.96*errore.no)
(Intercept)
 0.54

However, when I use the confint function I got:

> plogis(confint(oso.3))
Waiting for profiling to be done...
   2.5 % 97.5 %
(Intercept) 0.0076   0.45
schoolyes   0.8025   1.00

Here, I am looking at only to the intercept that is the reference level, 
"no").

I was expecting to get the same lower and upper limit for the intercept.
Do you know why the results are different?
Do I need the covariance to calculate the se?
Thank you very much in advance.
Best,

Manuel


--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Analyzing frequencies in R

2009-06-08 Thread Manuel Spínola

Dear list members,

If I have 3 frequencies (3 mutually exclusive groups):

white: 19
black: 43
red: 24

How can I obtain confidence intervals for the proportions, instead of a 
P value from a chisquare test in R?
Or better, how can I assess "effect size" instead of finishing the 
analysis on a P value when analyzing frequencies in R?

Is it possible to obtain standardized Pearson residuals in this situation?
Thank you very much in advance.
Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] testing for distribution

2009-05-13 Thread Manuel Spínola

Dear Jacob,

May be you can use cluster sampling or adaptive cluster sampling  
(Design-based estimation) to get a density estimate.

Best,

Manuel Spínola

Capelle, Jacob wrote:

Dear all,
 
I have a kind of a theoretical question from which I hope it might interest you and hopefully can help me a bit.
 
In order to obtain ecological (surrvey) data, I try to make a prediction about the accuracy of a sampling tool to estimate mussel density. For this reason I took a lot of samples at a certain fixed location and counted the amount of mussels in each sample. Because mussels are aggregated on the sediment, I had a lot of zero values. To estimate the sample size I used a binomial distribution and obtained the k value and the mu from the fitdistr(x,"negative binomial") (MASS).
 
The question I have is: how can I test if this distribution accurately described my (zero inflated count) data?
 
I am a bit familiar with the AIC but since I only have counts on one variable I cannot perform a GLS. 
Creating a vector with rnbinom() using the k and mu from the fitdistr() I plotted a histogram and compared it with my data, this showed that is was roughly comparable, but I want to quantify this.
 
I have a biological background not a statistical one, so I realize I can ask silly questions.
But I hope someone can give me some hints. 
 
Kind regards,
 
Jacob Capelle
 
PhD student

Wageningen Imares
The Netherlands
jacob.cape...@wur.nl <mailto:jacob.cape...@wur.nl> 


___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


  



--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Constrained quadratic ordination in VGAM

2009-03-10 Thread Manuel Spínola
Dear list members,

I am running a constrained quadratic ordination (cqo) from package VGAM.  I
contacted the author package, Thomas Yee, regarding to inertia in cqo but he
is not aware of inertia.
Has anybody worked trhough cqo and know how to obtain constrained variance
in the cqo context?
Thank you very much in advance.
Best,

Manuel

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] 2 questions about NMDS in vegan

2009-03-08 Thread Manuel Spínola

Dear list members,

I am trying to run an NMDS with 9 standardized variables regarding to 
water quality and I got the following message:


> aguae.mds <- metaMDS(aguae, dist="euclidean", k=2, zerodist="add")
Using step-across dissimilarities:
Too long or NA distances: 564 out of 666 (84.7%)
Stepping across 666 dissimilarities...
Error in isoMDS(dist, k = k, trace = isotrace) :
an initial configuration must be supplied with NA/Infs in 'd'
In addition: Warning messages:
1: In metaMDSdist(comm, distance = distance, autotransform = 
autotransform,  :

Zero dissimilarities changed into 0.0759809585356366
2: In stepacross(dis, trace = trace, ...) :
Disconnected data: Result will contain NAs
3: In metaMDSdist(comm, distance = distance, autotransform = 
autotransform,  :

Data are disconnected, results may be meaningless

1) Should I do not standardize the variables?

2) In a plot for a nmds with fitted environmental variables (function 
envfit) how can I change the name of the labels of the vectors (arrows)?


Thank you very much in advance.
Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Possion model for paired data

2009-03-06 Thread Manuel Spínola
Dear list memebers,

Is there a way to do a paired t test but using a poisson model (for counts).
Thank you very much in advance.
Best,

Manuel Spínola

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Problems with correspondence analysis in vegan

2009-02-22 Thread Manuel Spínola

Dear list members,

I am trying to run a correspondence analysis with cca function (package: 
vegan).

I got the following message:

> ca1 = cca(roeesp)
Error in data.frame(sitenv) :
 argument "sitenv" is missing, with no default

Even I tried the example form the vegan tutorial and I got the same message:

cca(varespec)
Error in data.frame(sitenv) :
 argument "sitenv" is missing, with no default

I ran a PCA with rda function on the same data set (roeesp) and no problem.

I am working with R 2.8.0, Windows plataform.

Thank you very much in advance.
Best,

Manuel

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Multivariate regression tree (mvpart)

2009-02-19 Thread Manuel Spínola

Dear list members,

I am working with the mvpart package.
The plot for a multivariate tree give 2 numbers associated to each 
terminal node, one is the number of sampling units. Does anybody know 
what the other number mean?

Also, is there any other package that handle multivariate regression trees?
Thank you very much in advance.
Best,

Manuel

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gamil.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Intepreting a plot from a "constrained" NMDS

2008-12-07 Thread Manuel Spínola

Dear list members,

Is there any reference or document on how to interpret a "constrained" 
non-metrical multidimensional scaling using ecological data?  By 
"constrained" I mean after fitting environmental covariables, using, for 
example, the "envfit" function in the vegan package.  Is it possible to 
interpret the resulting plot in the same way that a constrained 
ordination, for example CCA?

Thank you very much in advance.
Best,

Manuel

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Problems with vegdist in Vegan

2008-11-27 Thread Manuel Spínola

Dear list members,

I am runnig a NMDS in Vegan (version 1.13.2, Windows) and I get the 
following message with the function vegdist:


> aves.dis <- vegdist(avesp.esp, dist="jaccard")
Warning messages:
1: In vegdist(avesp.esp, dist = "jaccard") :
 you have empty rows: their dissimilarities may be meaningless in 
method bray


2: In vegdist(avesp.esp, dist = "jaccard") : missing values in results

I have sites (point counts) without species, is it a problem?
Thank you very much in advance.
Best,

Manuel Spínola

--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Teléfono: 277-3598
Fax: 237-7036

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


  1   2   >