Re: [R] Adding up normally distributed numbers seems to not create a t-distribution

2013-10-26 Thread Tsjerk Wassenaar
Hi :) Try this with other distributions too... And then search for 'central limit theorem'. Cheers, Tsjerk On Fri, Oct 25, 2013 at 4:48 PM, Kramer, Christian christian.kra...@uibk.ac.at wrote: Hi there, I have found a strange behavior in R that puzzles me - maybe it is a bug or a basic

[R] No speed effect by using RcppArmadillo compared to R in matrix operations

2013-10-26 Thread Timo Schmid
Hello, I am looking for a way to do fast matrix operations (multiplication, Inversion) for large matrices (n=8000) in R. I know R is not that fast in linear algebra than other software. So I wanted to write some code in C++ and incorporate this code in R. I have used the package RcppArmadillo,

Re: [R] Am I working with regularly spaced time series?

2013-10-26 Thread Weiwu Zhang
2013/10/22 Gabor Grothendieck ggrothendi...@gmail.com: Also note that the zoo package has two classes: 1. zoo for irregularly spaced series 2. zooreg for series with an underlying regularity but for which some of the points are missing (which seems to be the situation under discussion) The

[R] zero inflated Poisson - goodness of fit of distribution

2013-10-26 Thread MegP
Hi, I am using a zero inflated Poisson to model a dependent variable. How do I find out whether the zero-inflated Poisson is a good approximation of the variable? So far I have: m1 - zeroinfl(Join_Count_6m ~ 1, data = Megdata) summary(m1) Call: zeroinfl(formula = Join_Count_6m ~ 1, data =

[R] OT: The topic of reproducibility in the media

2013-10-26 Thread Liviu Andronic
Dear all, I know that reproducibility is a big concern for the R community, so it may be interesting to some of the readers on this list that The Economist recently ran a series of articles denouncing the alarming number of shoddy and non-reproducible published papers:

Re: [R] Adding up normally distributed numbers seems to not create a t-distribution

2013-10-26 Thread Rolf Turner
Absolutely nothing to do with the CLT. If X_1, ..., X_n are i.i.d. N(mu, sigma^2) then Xbar is N(mu,sigma^2/n). Exactly. No asymptotics, no approximations, no CLT. cheers, Rolf Turner On 10/26/13 20:17, Tsjerk Wassenaar wrote: Hi :) Try this with other distributions too...

Re: [R] Adding up normally distributed numbers seems to not create a t-distribution

2013-10-26 Thread Tsjerk Wassenaar
Of course. But the point is that this would happen with summing samples from any distribution. Cheers, Tsjerk On Sat, Oct 26, 2013 at 10:14 AM, Rolf Turner r.tur...@auckland.ac.nzwrote: Absolutely nothing to do with the CLT. If X_1, ..., X_n are i.i.d. N(mu, sigma^2) then Xbar is

Re: [R] OT: The topic of reproducibility in the media

2013-10-26 Thread Rolf Turner
Reproducibility is indeed important. From the point of view of those in the statistics community and in particular in the R community, the key issue is that the data on which a publication is based should be readily accessible so that others can replicate and possibly extend the analysis,

Re: [R] Adding up normally distributed numbers seems to not create a t-distribution

2013-10-26 Thread Rolf Turner
On 10/26/13 21:20, Tsjerk Wassenaar wrote: Of course. But the point is that this would happen with summing samples from any distribution. ***What*** would happen? You are confused about the t-distribution. (And the CLT and probably a lot of other things.) Back to the text-books.

Re: [R] Quick help needed in coding quantile normalization

2013-10-26 Thread Jeff Newmiller
Couple of problems: 1) The Posting Guide clearly states that this is not a homework help forum. We don't know what rules your study is constrained by, but if you are doing homework then we do know you have resources at your educational institution to rely on. 2) If this is not homework, why

[R] Inscrutable error message in mgcv: 1 prediction = predict(MI, se.fit=TRUE, newdata=rhc), Error in if (object$inter) X[[i]] - PredictMat(object$margin[[i]], dat, : , argument is of length zero

2013-10-26 Thread Andrew Crane-Droesch
Dear List, I am trying to reproduce a figure that I made for an analysis that I did a few months ago. Between when I first made the figure and now, I've upgraded to R 3.0.2 and upgraded my operating system (ubuntu 13.04). My codebase, which once works, is throwing an error when I try to use

Re: [R] No speed effect by using RcppArmadillo compared to R in matrix operations

2013-10-26 Thread Jeff Newmiller
I think you don't have accurate information about the speed of R in performing linear algebra computations. It relies on standard numerical libraries for that work, so it is as fast as those libraries are (you are unlikely to beat even an unoptimized version of those libraries with your ad hoc

Re: [R] Adding up normally distributed numbers seems to not create a t-distribution

2013-10-26 Thread Tsjerk Wassenaar
In addition to being confused about many things, I got out of bed far too early for a Saturday ;) I see I misunderstood the question, and it certainly doesn't hurt to go back to text books now and again... x-cbind(rnorm(1000),rnorm(1000),rnorm(1000)) m-rowMeans(x) s-apply(x,1,sd)

Re: [R] data frame pointers?

2013-10-26 Thread arun
Hi Jonathan,If you look at the str()  str(res) 'data.frame':    2 obs. of  4 variables:  $ gene  : chr  gene1 gene2  $ case_1:List of 2   ..$ : chr  nsyn amp   ..$ : chr  $ case_2:List of 2   ..$ : chr del   ..$ : chr  $ case_3:List of 2   ..$ : chr   ..$ : chr UTR In this case,

Re: [R] OT: The topic of reproducibility in the media

2013-10-26 Thread Jim Lemon
On 10/26/2013 07:06 PM, Liviu Andronic wrote: Dear all, I know that reproducibility is a big concern for the R community, so it may be interesting to some of the readers on this list that The Economist recently ran a series of articles denouncing the alarming number of shoddy and

Re: [R] No speed effect by using RcppArmadillo compared to R in matrix operations

2013-10-26 Thread Andreas Recktenwald
Hi, another option if you're using Linux AND an Intel processor would be linking R against Intel MKL (Math Kernel Library). Under Linux you can get a (free) non-commercial licence for it. Here I'm using an Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz laptop processor with R 3.0.2 build with

Re: [R] problem fitting 2 term exponential with nls

2013-10-26 Thread William Dunlap
fit-nls(d$time~a1*exp(b1*d$age) + a2*exp(b2*d$age)+c ,start(a1=10,b1=0,a2=250,b2=1,c=0) This line should read: start=list(a1=10,b1=0,a2=250,b2=1,c=0) After you fix that you will run into another problem Error in nls(d$time ~ a1 * exp(b1 * d$age) + a2 * exp(b2 * d$age) + c, :

[R] Problems with lme random slope+intercept model

2013-10-26 Thread anord
Dear all, I'm trying to fit a model on ecological data in which I have measured a few biotic and abiotic factors over the course of a few days in several individuals. Specifically, I'm interested in modelling y ~ x1, with x2, x3, and 'factor' as independent variables. Because data suggests both

[R] Compare two lists, with their sublists that have same structure

2013-10-26 Thread Alaios
Dear all, I would like to ask your help concering two R lists. If I did everything should have the same structure (that means the same number of sublists, and their sublists also the same number of sublists). What would change between the two lists is the contents of each element in the lists.

Re: [R] Compare two lists, with their sublists that have same structure

2013-10-26 Thread Bert Gunter
Warning: This may not be helpful. If I understand you correctly, you have two arbitrary lists of the same structure whose contents you wish to compare. You have not specified exactly what sort of comparison you wish to make, e.g. just are they the same? or What is the nature of any differences?

[R] Strange results from dbeta function

2013-10-26 Thread Noah Silverman
Hello, I’m seeing some strange behavior from the dbeta() function in R. For example: dbeta(0.0001, .4, .6 ) [1] 76.04555 How is it possible to get a PDF that is greater than 1?? Am I doing something wrong here, or is this a quirk of R. Thanks, -- Noah Silverman, M.S., C.Phil UCLA

Re: [R] Strange results from dbeta function

2013-10-26 Thread Bert Gunter
I suggest you review your stat101 text: A cdf is between 0 and 1, not a pdf, which is a **density** function. dnorm(0, sd=.01) [1] 39.89423 -- Bert On Sat, Oct 26, 2013 at 11:31 AM, Noah Silverman noahsilver...@ucla.edu wrote: Hello, I’m seeing some strange behavior from the dbeta()

Re: [R] find and add text

2013-10-26 Thread arun
Hi, You may try: dat2 - data.frame(col1=data,col2=as.character(factor(data,labels=c(positive,negative))),stringsAsFactors=FALSE) A.K. Hello all, I have a data something like this; data- c(a, b,b,b,a,a,b,a,b) and I need to represent all a's as positive  and b's negative in data.frame

Re: [R] find and add text

2013-10-26 Thread arun
Hi, No problem. Try: data.frame(col1=data,col2=as.character(factor(gsub(\\d+,,data),labels=c(positive,negative))),stringsAsFactors=FALSE) A.K. Hello Arun, Thank you so much,  it works great. But I some sets, the data contains some additional characters also, like a1, a2, a3b1,b2

Re: [R] No speed effect by using RcppArmadillo compared to R in matrix operations

2013-10-26 Thread Dirk Eddelbuettel
Andreas Recktenwald a.recktenwald at mx.uni-saarland.de writes: another option if you're using Linux AND an Intel processor would be linking R against Intel MKL (Math Kernel Library). Under Linux you can You do not have to link R against MKL. One simply builds and links R against _any_

Re: [R] add a color band

2013-10-26 Thread Alaios
Hi Jim and thanks for your answer... I might be too tired with my new born or just exhausted. I am attaching for everyone a small data snipset that you can load load(DataToPlotAsImage.Rdata) require(plotrix) browser() test-data # this transforms the values of test into red-yellow

[R] Heteroscedasticity and mgcv.

2013-10-26 Thread Collin Lynch
I have a two part question one about statistical theory and the other about implementations in R. Thank you for all help in advance. (1) Am I correct in understanding that Heteroscedasticity is a problem for Generalized Additive Models as it is for standard linear models? I am asking