Re: [R] variance of discrete uniform distribution

2010-03-08 Thread Michael Erickson
On Mon, Mar 8, 2010 at 3:44 PM, casperyc caspe...@hotmail.co.uk wrote: Hi Rolf Turner , God, it directed to the wrong page. I firstly find the formula in wiki, than tried to verify the answer in R, now, given that 143/12 ((n^2-1)/12 ) is the correct answer for a discrete uniform random

Re: [R] limit to p-value using t.test()

2010-02-06 Thread Michael Erickson
On Sat, Feb 6, 2010 at 8:53 AM, Pete Shepard peter.shep...@gmail.com wrote: I am using t-test to check if the difference between two populations is significant. I have a large N=20,000, 10,000 in each population. I compare a few different populations with each other and though I get different

Re: [R] R on amazon's EC2 cloud?

2009-12-29 Thread Michael Erickson
On Sun, Dec 27, 2009 at 3:33 PM, Carlos J. Gil Bellosta c...@datanalytics.com wrote: I tried Amazon EC2 with R recently and wrote an entry about it to a blog I collaborate with: http://analisisydecision.es/probando-r-sobre-el-ec2-de-amazon/ (Unfortunately, it is in Spanish...) Google's

Re: [R] [ how can sample from f(x)~x^(a-1)

2009-12-26 Thread Michael Erickson
On Fri, Dec 25, 2009 at 8:07 AM, khaz...@ceremade.dauphine.fr wrote: Hello all how can sample from f(x)~x^(a-1)*ind(0,min(b,-log(u)) in R? where a and b is positive constand and 0u1 If the idea is that X is a random variable, then you need to decide what kind of random variable it is. For

Re: [R] regex question

2009-08-04 Thread Michael Erickson
Here's what I came up with: gsub((\\w)[^ ]+[\\b ], \\1, astr) [1] Timtowtdit You might be interested in Regular Expressions Cookbook from O'Reilly (publisher not author) or http://www.regular-expressions.info/ I usually bumble along knowing there are better ways to do whatever I am doing.

[R] Hmisc summarize() with level in by variable

2009-06-13 Thread Michael Erickson
I was using summarize() in a data set in which one of the levels of the by variable was . The summary statistic was consistently off by one level and the level was not in the output data frame. I tried to report it as a bug, but I could not log into the Hmisc bug reporting website to do so. I

[R] latex(Hmisc): cgroup + rownames shifts column names

2009-04-23 Thread Michael Erickson
I have submitted this as a bug (http://biostat.mc.vanderbilt.edu/trac/Hmisc/ticket/29) but I am wondering if anyone else has seen it or perhaps developed a workaround. I could certainly fix the LaTeX by hand, but I am using this inside Sweave, so it is a bit cumbersome. The exact same code used