Re: [R] loop

2014-10-05 Thread jim holtman
Please don't post in HTML since your code was all messed up. You did not mention what problems you were having with your code. Now a couple of things to check is to look at what the structure of "r" that you are trying to add to "sum" (which should have been "Sum" according to your assignment ear

[R] CRAN (and crantastic) updates this week

2014-10-05 Thread Crantastic
CRAN (and crantastic) updates this week New packages * activity (1.0) Maintainer: Marcus Rowcliffe Author(s): Marcus Rowcliffe License: GPL-3 http://crantastic.org/packages/activity Provides functions to fit kernel density functions to animal activity time data; plot ac

[R] loop

2014-10-05 Thread pari hesabi
Hello ,I am trying to write a loop for sum of integrals . the integral is:integrand4<-function(x,a=1.5,n=3,k=0){(((a+1)*x)^k)*((2-x)^n)*(exp(-a*x-2))/(factorial(k)*factorial(n))} integrate(integrand4,0,2). I need a loop to give me the sum of integrals over k = 0,.n , for every positive inte

Re: [R] Caret and Model Prediction

2014-10-05 Thread Lorenzo Isella
Thanks a lot. At this point then I wonder: seen that my response consists of 5 outcomes for each set of features, should I then train 5 different models (one for each of them)? Cheers Lorenzo On Sun, Oct 05, 2014 at 11:04:01AM -0700, Jia Xu wrote: Hi, Lorenzo: For 1) I think the formula is not

[R] n-gram error with packages tau, tm, RTextTools

2014-10-05 Thread email
Hi: I am trying to compute n-grams using package tm and tau with following code: tokenize_ngrams <- function(x, n=3) return(rownames(as.data.frame(unclass(textcnt(x,method="string",n=n) texts <- c("This is the first document.", "This is the second file.", "This is the third text.") corpus <-

Re: [R] Caret and Model Prediction

2014-10-05 Thread Jia Xu
Hi, Lorenzo: For 1) I think the formula is not correct. The formula should be outcome ~ features, and that's why you have weird result in 3) 2) predict in caret will automatically find the best result one if there is one(sometimes it fails). You can print the model to see the cross validation

Re: [R] truncated normal

2014-10-05 Thread Bert Gunter
... yes. ... And do note that in sampling, truncated != censored. (They are often confused) Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Sun, Oct 5

Re: [R] truncated normal

2014-10-05 Thread Ben Bolker
Bob O'Hara gmail.com> writes: > > This isn't an R question at all, so I don't know why it's on this list. But > the best answer I've got is "a truncated t-distribution with an infinite > number of degrees of freedom". > > Bob Or, perhaps more productively: "since your question is a general

[R] Caret and Model Prediction

2014-10-05 Thread Lorenzo Isella
Dear All, I am learning the ropes of CARET for automatic model training, more or less following the steps of the tutorial at http://bit.ly/ZJQINa However, there are a few things about which I would like a piece of advice. Consider for instance the following model ##

Re: [R] truncated normal

2014-10-05 Thread Bob O'Hara
This isn't an R question at all, so I don't know why it's on this list. But the best answer I've got is "a truncated t-distribution with an infinite number of degrees of freedom". Bob On 5 October 2014 17:18, thanoon younis wrote: > Dear all R-users > I have a question regarding truncated norma

[R] truncated normal

2014-10-05 Thread thanoon younis
Dear all R-users I have a question regarding truncated normal distribution : which type of probability distribution has same properties of truncated normal distribution? Many thanks in advance -- Thanoon Y. Thanoon PhD Candidate Department of Mathematical Sciences Faculty of Science University T

Re: [R] Removing description from lm()

2014-10-05 Thread billy am
Thats it! Most splendid! Thanks! The final result, just the value alone , for future reference. > x <- c(1,5,3,1)> y <- c(5,8,2,3)> lm(x~y)$coefficient[1](Intercept) 0.5714286 > cat(lm(x~y)$coefficient[1])0.5714286 > Thanks everyone! Regards Billy On Sun, Oct 5, 2014 at 10:37 PM, peter

Re: [R] Removing description from lm()

2014-10-05 Thread peter dalgaard
On 05 Oct 2014, at 16:06 , billy am wrote: > Thank you both very much. It is the unname that is what I am looking for. > Thanks! > > Btw , must the [1] be there? I am writing a Shiny web app hence I would > like to display the value alone. > It's part of standard printing of unnamed vectors.

Re: [R] Removing description from lm()

2014-10-05 Thread Duncan Murdoch
On 05/10/2014, 10:06 AM, billy am wrote: > Thank you both very much. It is the unname that is what I am looking > for. Thanks! > > Btw , must the [1] be there? I am writing a Shiny web app hence I would > like to display the value alone. Try leaving it out, and you'll see what it's for. (It is g

Re: [R] Removing description from lm()

2014-10-05 Thread billy am
Thank you both very much. It is the unname that is what I am looking for. Thanks! Btw , must the [1] be there? I am writing a Shiny web app hence I would like to display the value alone. Thanks! > unname(lm(x~y)$coefficient[1])[1] 0.5714286> > coef(lm(x~y))["(Intercept)"](Intercept) 0.5714286

Re: [R] comparing two "half-normal production" stochastic frontier functions

2014-10-05 Thread Rainer M Krug
Arne Henningsen writes: > Dear Rainer > > On 3 October 2014 14:51, Rainer M Krug wrote: >> I am using the function frontier::sfa (from the package frontier) to >> estimate several "half-normal production" stochastic frontier functions. >> >> Now I want to compare the coefficients of the linear

Re: [R] Removing description from lm()

2014-10-05 Thread Uwe Ligges
On 05.10.2014 15:02, Duncan Murdoch wrote: On 05/10/2014, 7:21 AM, billy am wrote: Hi , When I run the following code , I get both the description and the value , eg : Intercept and 0.5714286. Is there a way to extract just the value 0.5714286? Thanks! x <- c(1,5,3,1)> y <- c(5,8,2,3)> lm

Re: [R] Removing description from lm()

2014-10-05 Thread Duncan Murdoch
On 05/10/2014, 7:21 AM, billy am wrote: > Hi , > > When I run the following code , I get both the description and the value , > eg : Intercept and 0.5714286. > > Is there a way to extract just the value 0.5714286? Thanks! > > >> x <- c(1,5,3,1)> y <- c(5,8,2,3)> lm(x~y) > Call: > lm(formula = x

[R] Removing description from lm()

2014-10-05 Thread billy am
Hi , When I run the following code , I get both the description and the value , eg : Intercept and 0.5714286. Is there a way to extract just the value 0.5714286? Thanks! > x <- c(1,5,3,1)> y <- c(5,8,2,3)> lm(x~y) Call: lm(formula = x ~ y) Coefficients: (Intercept)y 0.5714