Re: [R] strange behavior of lchoose in combinatorics problem

2016-06-25 Thread peter dalgaard
> On 25 Jun 2016, at 16:13 , Gonçalo Ferraz wrote: > > PROBLEM: the sum of the probabilities in lpvec should be <=1, but it is not. > The sum is something on the order of 1.48e-13. Um, in which sense is 1.48e-13 not <=1 ??? -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Bus

[R] function for over dispersed poisson regression in the setting of a random effects model

2016-06-25 Thread John Sorkin
Is there a function that will run a model appropriate for over dispersed data (such as a negative binomial or quasipoisson) with a random effects (or mixed effects) model in R? GLMER will not accept: family=quasipoisson(link="log") or family=negbinomial(link="log") I want to run something lik

Re: [R] Help with the Cut Function

2016-06-25 Thread David Winsemius
> On Jun 25, 2016, at 4:24 PM, Shivi Bhatia wrote: > > Hi David, > > I tried as suggested however with this code: > Age11<- cut(desc$Age, breaks = c(-Inf, 20,30,40,Inf),labels = > c("Low","Mid","Top")) Read the error message and add in another item to the 'labels' vector. Perhaps: c( "<=

Re: [R] strange behavior of lchoose in combinatorics problem

2016-06-25 Thread Richard M. Heiberger
Floating point numbers are rounded to 53 significant bits. When you use logs of integers you are using floating point numbers. > .3 + .6 == .9 [1] FALSE > (.3 + .6) - .9 [1] -1.110223e-16 See FAQ 7.31 for more discussion. On Sat, Jun 25, 2016 at 10:13 AM, Gonçalo Ferraz wrote: > Hi, > > I am w

Re: [R] Help with the Cut Function

2016-06-25 Thread Shivi Bhatia
Hi David, I tried as suggested however with this code: Age11<- cut(desc$Age, breaks = c(-Inf, 20,30,40,Inf),labels = c("Low","Mid","Top")) i receive an error message as below: lengths of 'breaks' and 'labels' differ. Now as a result i have values exceeding 40 as N/A. On Sun, Jun 26, 2016 at 3:25

[R] strange behavior of lchoose in combinatorics problem

2016-06-25 Thread Gonçalo Ferraz
Hi, I am working on interactions between animals, studying whether animal 1 is attracted to animal 2 (or vice-versa). I looked for the two animals in N=2178 sampling occasions, finding animal 1 a total of N1=165 times, and animal 2 a total of N2=331 times. In J=97 occasions, I saw both animals

Re: [R] Help with the Cut Function

2016-06-25 Thread David Winsemius
> On Jun 25, 2016, at 12:05 PM, Shivi Bhatia wrote: > > Dear Team, > > Please see the code below: > > Age1<- cut(desc$Age, breaks = c(20,30,40,Inf),labels = c("Low","Mid","Top")) Try instead: Age1<- cut(desc$Age, breaks = c(-Inf, 20,30,40,Inf),labels = c("Low","Mid","Top")) Do note that va

Re: [R] Error using function seas()

2016-06-25 Thread Rolf Turner
This is identical to the question that you previously asked and you still have not addressed the problem of making your example *reproducible*. cheers, Rolf Turner On 26/06/16 01:52, T.Riedle wrote: Dear all, I am trying to run the seas() function. If I run the seas() function as shown be

Re: [R] [FORGED] Help with the Cut Function

2016-06-25 Thread Rolf Turner
On 26/06/16 07:05, Shivi Bhatia wrote: Dear Team, Please see the code below: Age1<- cut(desc$Age, breaks = c(20,30,40,Inf),labels = c("Low","Mid","Top")) here i am creating three categories as mentioned from the age var from desc data set. All the values are set correctly however the values whi

Re: [R] [FORGED] Re: Rattle

2016-06-25 Thread Achim Zeileis
On Sat, 25 Jun 2016, Rolf Turner wrote: On 25/06/16 09:13, Jeff Newmiller wrote: This is like asking, "My car doesn't work. Can anyone tell me what is wrong?" Fortune nomination! On R-Forge now. Z cheers, Rolf -- Technical Editor ANZJS Department of Statistics University of Aucklan

[R] Help with the Cut Function

2016-06-25 Thread Shivi Bhatia
Dear Team, Please see the code below: Age1<- cut(desc$Age, breaks = c(20,30,40,Inf),labels = c("Low","Mid","Top")) here i am creating three categories as mentioned from the age var from desc data set. All the values are set correctly however the values which are below 20 are set to NA. Is there a

[R] Error using function seas()

2016-06-25 Thread T.Riedle
Dear all, I am trying to run the seas() function. If I run the seas() function as shown below I get following errors. What is wrong with my code? > data<-Shiller_data[,2] > ts<-ts(data,start=c(1871, 01), end=c(2015, 12), frequency=12) > ts Jan Feb Mar Apr May Jun