[R] similarity test with R

2006-12-11 Thread Ethan Johnsons
x=c(3.05176E-05,0.000457764,0.003204346,0.0138855,0.04165649,0.09164429,0.1527405,0.1963806,0.1963806,0.1527405,0.09164429,0.04165649,0.0138855,0.003204346,0.000457764,3.05176E-05)

[R] Error in rmultinom(n, size, prob) : too few positive probabilities

2006-12-09 Thread Ethan Johnsons
// R 2.3.1 Can someone please explain why this error returns? y=numeric(100) x=matrix(runif(16),4,4) for(i in 2:100) +{ + y[i]=which(rmultinom(1, size = 1, prob = x[y[i-1], ])==1) +} Error in rmultinom(n, size, prob) : too few positive probabilities thx much ej

[R] Simulation with R

2006-12-08 Thread Ethan Johnsons
An apparatus exists whereby a collection of balls is displaced to the top of a stack by suction. A top level (Level 1) each ball is shifted 1 unit to the left or 1 unit to the right at random with equal probability. The ball then drops down to level 2. At Level 2, each ball is again shifted 1 unit

Re: [R] Chi-Square Goodness-of-Fit test

2006-12-06 Thread Ethan Johnsons
-square distribution (pchisq). I am a newbie in R. Your help will be greatly appreciated. Thx ej On 12/5/06, Don McKenzie [EMAIL PROTECTED] wrote: Ethan Johnsons wrote: If we use this data as an example, does ks.test still valid? E.Coli GroupObservedExpected A5777.9 B

Re: [R] prop.trend.test issue

2006-12-04 Thread Ethan Johnsons
On 12/4/06, Bernardo Rangel tura [EMAIL PROTECTED] wrote: At 03:55 AM 12/3/2006, Ethan Johnsons wrote: I have the clinical study data. Year 0 Year 3 Retinol (nmol/L)N Mean +-sd Mean +-sd Vitamin A group 73

[R] Chi-Square Goodness-of-Fit test

2006-12-04 Thread Ethan Johnsons
Do you know/have a function that takes a vector x and provides a returned p-value that uses the Chi-Square Goodness-of-Fit test to test the goodness of fit of a standard normal distribution. Awaiting your positive reply. Thx ej __

Re: [R] Chi-Square Goodness-of-Fit test

2006-12-04 Thread Ethan Johnsons
want to do this test. HTH, Simon. Ethan Johnsons wrote: Do you know/have a function that takes a vector x and provides a returned p-value that uses the Chi-Square Goodness-of-Fit test to test the goodness of fit of a standard normal distribution. Awaiting your positive reply. Thx ej

Re: [R] prop.trend.test issue

2006-12-03 Thread Ethan Johnsons
I don't find any other test avail for this? Am I missing something? thx ej On 12/3/06, Michael Dewey [EMAIL PROTECTED] wrote: At 05:55 03/12/2006, Ethan Johnsons wrote: I have the clinical study data. Year 0 Year 3 Retinol (nmol/L

[R] Chi-squared approximation may be incorrect in: chisq.test(x)

2006-12-02 Thread Ethan Johnsons
I am getting Chi-squared approximation may be incorrect in: chisq.test(x) with the data bleow. Frequency distribution of number of male offspring in families of size 5. Number of Male OffspringN 0 518 12245 2

[R] prop.trend.test issue

2006-12-02 Thread Ethan Johnsons
I have the clinical study data. Year 0 Year 3 Retinol (nmol/L)N Mean +-sd Mean +-sd Vitamin A group 73 1.89+-0.36 2.06+-0.53 Trace group57 1.83+-0.31 1.78+-0.30 where N is the number

[R] power.z.test

2006-10-30 Thread Ethan Johnsons
Does anyone have/know how to write the power function for z tests something like below? function(a,m0,m1,n,s){ t1 = -qnorm(1-a) num = abs(m0-m1) * sqrt(n) t2 = num/s pow = pnorm(t1 + t2) } thx much ej __ R-help@stat.math.ethz.ch mailing list

[R] Power of test

2006-10-27 Thread Ethan Johnsons
What would be the R formulae for a two-sided test? I have a formula for a one-sided test: powertest - function(a,m0,m1,n,s){ t1 = -qnorm(1-a) num = abs(m0-m1) * sqrt(n) t2 = num/s pow = pnorm(t1 + t2) } Would you pls let me know if you know of? Thank you, ej

Re: [R] Power of test

2006-10-27 Thread Ethan Johnsons
) Thank you, ej On 27 Oct 2006 16:37:08 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: Ethan Johnsons [EMAIL PROTECTED] writes: What would be the R formulae for a two-sided test? I have a formula for a one-sided test: powertest - function(a,m0,m1,n,s){ t1 = -qnorm(1-a) num = abs(m0-m1

Re: [R] Power of test

2006-10-27 Thread Ethan Johnsons
considered what they do not say. ~William W. Watt A statistical analysis, properly conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Ethan Johnsons Verzonden

Re: [R] Power of test

2006-10-27 Thread Ethan Johnsons
PROTECTED] [mailto:[EMAIL PROTECTED] Namens Ethan Johnsons Verzonden: vrijdag 27 oktober 2006 16:59 Aan: Peter Dalgaard CC: r-help@stat.math.ethz.ch Onderwerp: Re: [R] Power of test Thank you so mcuh for the explanation, Chuck Peter. Two quick questions,please. It states that delta

Re: [R] CI with sd

2006-10-20 Thread Ethan Johnsons
Thank you so much. I see your point. ej On 10/20/06, Petr Pikal [EMAIL PROTECTED] wrote: Hi On 19 Oct 2006 at 13:19, Ethan Johnsons wrote: Date sent: Thu, 19 Oct 2006 13:19:40 -0400 From: Ethan Johnsons [EMAIL PROTECTED] To: Chuck Cleland

[R] binom.test

2006-10-20 Thread Ethan Johnsons
A quick question, please. 46 e coli lab samples are tested, 6 of them returned positive. So, the best point estimate for p is 6/46 = 0.1304348. For a 95% CI for p, I thought binom.test would give me the correct result, but it seems it is not the right function to use. What is the R

Re: [R] binom.test

2006-10-20 Thread Ethan Johnsons
From: Ethan Johnsons [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] binom.test Date: Fri, 20 Oct 2006 17:18:02 -0400 A quick question, please. 46 e coli lab samples are tested, 6 of them returned positive. So, the best point estimate for p is 6/46 = 0.1304348

Re: [R] Re : CI

2006-10-19 Thread Ethan Johnsons
. - Message d'origine De : Ethan Johnsons [EMAIL PROTECTED] À : Liaw, Andy [EMAIL PROTECTED] Cc : r-help@stat.math.ethz.ch Envoyé le : Jeudi, 19 Octobre 2006, 5h43mn 36s Objet : Re: [R] CI Thx so much. I just got into R world for my small research. I thought that R is free so

[R] binom.test

2006-10-19 Thread Ethan Johnsons
R-experts: A quick question, please. From a lab exp, I got 12 positives out of 50. To get 90% CI for this , I think binom.test might be the one to be used. Is there a better way or function to calculate this? binom.test(x=12, n=50, p=12/50, conf.level = 0.90) Exact binomial test

[R] CI with sd

2006-10-19 Thread Ethan Johnsons
Please let me ask you another quick question. I have results for e coli, and am trying to get 95% CI with the sd (1.783956). I got the result from another tool as (1.21, 3.42). But, I like to verify it with R. What function do you use for this?

Re: [R] binom.test

2006-10-19 Thread Ethan Johnsons
Thx much for the feedback. It is a big help. ej On 10/19/06, Ted Harding [EMAIL PROTECTED] wrote: On 19-Oct-06 Ethan Johnsons wrote: R-experts: A quick question, please. From a lab exp, I got 12 positives out of 50. To get 90% CI for this , I think binom.test might be the one

Re: [R] CI with sd

2006-10-19 Thread Ethan Johnsons
Thx so much, Chuck. R is a reallt sweet tool to use.. I can try many things with i.e. intervals (gls(e.coli ~ 1), level=0.90). It is a great help. ej On 10/19/06, Chuck Cleland [EMAIL PROTECTED] wrote: Ethan Johnsons wrote: Please let me ask you another quick question. I have results

Re: [R] CI with sd

2006-10-19 Thread Ethan Johnsons
On 10/19/06, Chuck Cleland [EMAIL PROTECTED] wrote: Ethan Johnsons wrote: Please let me ask you another quick question. I have results for e coli, and am trying to get 95% CI with the sd (1.783956). I got the result from another tool as (1.21, 3.42). But, I like to verify it with R. What

[R] CI

2006-10-18 Thread Ethan Johnsons
I have a quick question, please. Does R have function to compute i.e. a 90% confidence interval for the mean for these numbers? mean (6,11,5,14,30,11,17,3,9,3,8,8) [1] 6 I thought pt or qt would give me the interval, but it seems not. thx much. ej

Re: [R] CI

2006-10-18 Thread Ethan Johnsons
of success 0.44 I hope these are not HW problems? Andy From: Ethan Johnsons Thank you so much for the feedback. The random numbers are working great. I have tried non-random numbers, and the outcome is not correct with confint. Is there a way to compute i.e

[R] binom calculation with range

2006-10-12 Thread Ethan Johnsons
What is the way to calculate the probability that between 1 and 5? i.e. We can do: pbinom(q=1,size=1000,prob=0.0005,lower.tail=FALSE) [1] 0.09016608 pbinom(q=5,size=1000,prob=0.0005,lower.tail=FALSE) [1] 1.398798e-05 pbinom(q=1:5,size=1000,prob=0.0005,lower.tail=FALSE) [1] 9.016608e-02

[R] ppois

2006-09-28 Thread Ethan Johnsons
33 died overa 10-year period from COPD, whereas only 24 such deaths could be expected based onstatewide mortality rates. I came up with ppois(q = 33, lambda = 24, lower.tail = FALSE), but it seems it is ppois(q = 32, lambda = 24, lower.tail = FALSE). I am confused with the q value. Why is it 32

Re: [R] Y-axis on pbinom

2006-09-23 Thread Ethan Johnsons
thx so much..Maciej . ej On 9/23/06, Maciej Bliziński [EMAIL PROTECTED] wrote: On Sat, 2006-09-23 at 01:37 -0400, Ethan Johnsons wrote: How do you change the Y-axis from 0 ~ 0.6? plot(..., ylim = c(0, 0.6)) -- Maciej Bliziński http://automatthias.wordpress.com

[R] pbinom with rnorm

2006-09-23 Thread Ethan Johnsons
Is there a way to plug in the random samples, rnorm(100), in this plot? I am using 100, but want it to be randome samples. plot(seq(from=0,to=100,by=1),1-pbinom (seq(from=0,to=100,by=1),size=100,prob=0.05),pch=15) thx much __ R-help@stat.math.ethz.ch

[R] Y-axis on pbinom

2006-09-22 Thread Ethan Johnsons
With this: plot(seq(from=0,to=10,by=1),1-pbinom (seq(from=0,to=10,by=1),size=6,prob=0.50),pch=15) How do you change the Y-axis from 0 ~ 0.6? I only get 0.0 ~1.0. thx much __ R-help@stat.math.ethz.ch mailing list

[R] binom

2006-09-20 Thread Ethan Johnsons
I have this data and calculated binom, but am very confused with the value (at least 5, q =4, q=5, q =6??) and parameters? Can someone explain how to plug in the va;ues and parameters? Hospital # Tested # Positive # Positive (per 1000) A 3741 30 8 C 5006 11 2.2 If 500 newborns are

[R] Poission distribution

2006-09-20 Thread Ethan Johnsons
The expected number of bladder cancer over next 20 years a tire industry is 1.8. Poission distribution is assumed to hold and 6 reported deaths are caused by bladder cancer among the employees. Trying to find how unusual this event is. ppois(q=6, lambda=1.8, lower.tail = TRUE, log.p = FALSE)

[R] ppois

2006-09-20 Thread Ethan Johnsons
A quick question! The number of episodes per year of otitis media follows a Possion distribution with lambda = 1.6 episodes per year. Wouldn't the probability of getting 3 or more episodes of otitis media in the first 2 years of life be: ppois(q=3, lambda=1.6*2, lower.tail = TRUE, log.p =

[R] hist for two sets

2006-09-14 Thread Ethan Johnsons
A quick question, please. x = c(0.0001, 0.0059, 0.0855, 0.9082) y = c(0.54, 0.813, 0.379, 0.35) where A = 1st set, B = 2nd set, C = 3rd set, D = 4th set respectivley. How do you make hist plot side by side for x y? i.e. 0.0001 and then to the right 0.54, 0.0059 and then to the right 0.813,

Re: [R] hist for two sets

2006-09-14 Thread Ethan Johnsons
thx so much, Marc. ej On 9/14/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Thu, 2006-09-14 at 19:37 -0400, Ethan Johnsons wrote: A quick question, please. x = c(0.0001, 0.0059, 0.0855, 0.9082) y = c(0.54, 0.813, 0.379, 0.35) where A = 1st set, B = 2nd set, C = 3rd set, D = 4th set

Re: [R] rename cols

2006-09-12 Thread Ethan Johnsons
1 1 4 2 2 5 3 3 6 For a data frame, 'names(x) - c(Apple, Orange)' also works, because a dataframe is stored internally as a list of columns. -- Tony Plate Ethan Johnsons wrote: A quick question please! How do you rename column names? i.e. V1 -- Apple

[R] extract a value from vector

2006-09-12 Thread Ethan Johnsons
A quick question, please! How do you extract a certain value of vector? i.e. x = c(2,5,3,6,21,3,6,24, ) How do you get the 1st one (which is 2); the 5th one (which is 21); etc? thx much, ej [[alternative HTML version deleted]] __

[R] rename cols

2006-09-11 Thread Ethan Johnsons
A quick question please! How do you rename column names? i.e. V1 -- Apple; V2 -- Orange, etc. thx much ej [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] rownumber

2006-09-10 Thread Ethan Johnsons
# R 2.3.1 I read the data set into R, but the data set have two rows per record. i.e. . 105 1 1 11031 5 4 8 5 22 105 2 2 2 2 1 2 17 16 26 106 1 2 606 1 5

Re: [R] there is no xls reader in R?

2006-04-21 Thread Johnsons
I have used the following successfully: xls = odbcConnectExcel(fname) Rawdata.temp = sqlQuery( chan, select * from [sheet1$], max=2800 ) close(xls) Presuming your data is in the Excel tab sheet1. Of course, this assumes that column headers are in the first row. Greg Johnson -Original