[R] months in circular

2012-08-18 Thread garciap
Hi to people in the forum, I'm doing some circular statistics in the package circular. My data is in hours and in months, and hours are easily recognised in the functions. However, it is not the case of months having only 12 potential values. I'm thinking in transform the data by dividing the cir

[R] error in optim: initial value in 'vmmin' is not finite

2012-02-23 Thread garciap
Dear r-helpers, I'm experiencing some problems in fitting a maximum likelihood binomial model to some of my data. The error is in optim, which founds: Error in optim(par = c(0.2, 0.5), fn = function (p) : initial value in 'vmmin' is not finite Yes, I know it's a common problem, and I've caref

[R] factors in probit regression

2011-10-06 Thread garciap
Hi to all of you, I'm fitting an full factorial probit model from an experiment, and I've the independent variables as factors. The model is as follows: fit16<-glm(Sube ~ as.factor(CE)*as.factor(CEBO)*as.factor(Luz), family=binomial(link="probit"), data=experimento) but, when I took a look to t

[R] Scheirer-Ray-Hare

2011-09-16 Thread garciap
Hello to all the people in the forum, I'm trying to perform a Scheirer-Ray-Hare test in R, and despite I've found some posts talking about this test, there no one in which I can found how to do so. Can anyone explain me how to do the test? Thanks Pablo -- View this message in context: http:/

[R] Own R function doubt

2011-08-13 Thread garciap
Hi to all the people again, I was writting a simply function in R, and wish to collect the results in a excel file. The work goes as follows, Ciervos<-function(K1, K0, A, R,M,Pi,Hembras) {B<-(K1-K0)/A T1<-(R*Pi*Hembras-M*Pi+B)/(Pi-M*Pi+R*Pi*Hembras) P1<-Pi-B R1<-P1*Hembras*R M1<-P1*M T2<-(R1-M1+B

[R] a question on plotting nonlinear regression

2011-07-24 Thread garciap
Hi to all the people, I'm having a trouble when trying to plot a quadratic function. I have the code: regression<-nls(Survival~beta1+beta2*PI+beta3*PI^2, data=cubs, start=list(beta1 = 1, beta2 = 1, beta3 = 1)) plot(Survival~PI,data=cubs, ylab="Survival", xlab="PI") lines(cubs$PI, fitted(regressio

[R] dynamic programming

2011-05-29 Thread garciap
Dear members of R forum, I'm trying to perform a simply dynamic programming model in R, following the reccomendations of Soetart & Herman (A practical guide to ecological modeling). However, I've obtained a number of problems, that I'm unable to solve (even thoughI've tried during at least 2 hours

[R] problem running a function

2011-03-19 Thread garciap
Dear people, I'm trying to do some analysis of a data using the models by Royle & Donazio in their fantastic book, particular the following function: http://www.mbr-pwrc.usgs.gov/pubanalysis/roylebook/panel4pt1.fn that applied to my data and in the console is as follows: > `desman.y` <- structure

[R] reading simulations

2011-02-19 Thread garciap
Hi to all the people (again), I'm doing some simulations with the memisc package of an own function, but I've the problem that I didn't know how to read the result of such simulations. My function is: > Torre<-function(a1,N1,a2,N2) + {Etorre<-(a1*N1)/(1+a1*N1) + Efuera<-(a2*N2)/(1+a2*N2) + if(Et

[R] MCMC glmm

2011-02-14 Thread garciap
Hi to all the people, I'm working with abundance data of some species, but containing too zero values, and the factors are the ones typical in a BACI experiment (Before-and-After-Control-Impact). Thus, these are two fixed factors. As the data does not holds the normality and homogeneity of varian

[R] kernel density

2011-02-07 Thread garciap
Hi all (again), many thanks for the answer to the optimization problem. All is fine now. The problem now is with kernel estimators in sm. package. I do all the work and the graphics good, but I need the density function data for each point, and I don't know how to get it. The only thing I get is

[R] function optimization

2011-02-06 Thread garciap
Dear all, this is my first time, and just begin to use R. But I've a question about optimization using optimx library. It could sound stupid by I'm a bit affraid with the problem, because anything I try, anything Error. The procedure was: optimx(par="10,71,1",fn=(Prey*Provisioning)/Risk, control