Re: [R] chisq.test

2013-03-05 Thread arun
If you wanted to do a t.test res1-do.call(cbind,lapply(seq_len(nrow(m)),function(i) do.call(rbind,lapply(split(rbind(m[i,-1],n),1:nrow(rbind(m[i,-1],n))), function(x) {x1- rbind(x,m[i,-1]); t.test(x1[1,],x1[2,])$p.value}  res2-do.call(cbind,lapply(seq_len(ncol(res1)),function(i)

Re: [R] chisq.test

2012-06-27 Thread John
On Wed, 27 Jun 2012 16:58:29 +1200 Rolf Turner rolf.tur...@xtra.co.nz wrote: On 27/06/12 08:54, arun wrote: Hi, The error is due to less than 5 observations in some cells. NO, NO, NO It's not the observations that matter, it is the ***EXPECTED COUNTS***. These must

Re: [R] chisq.test

2012-06-27 Thread Peter Ehlers
On 2012-06-26 23:02, John wrote: On Wed, 27 Jun 2012 16:58:29 +1200 Rolf Turnerrolf.tur...@xtra.co.nz wrote: On 27/06/12 08:54, arun wrote: Hi, The error is due to less than 5 observations in some cells. NO, NO, NO It's not the observations that matter, it is the

Re: [R] chisq.test

2012-06-27 Thread Omphalodes Verna
Dear all! Thanks for clarification. OV To: Rolf Turner rolf.tur...@xtra.co.nz Sent: Wednesday, June 27, 2012 1:33 PM Subject: Re: [R] chisq.test Hi Rolf, Thanks for spotting the mistake.  A.K. - Original Message - From: Rolf Turner rolf.tur

[R] chisq.test

2012-06-26 Thread Omphalodes Verna
Dear list! I would like to calculate chisq.test on simple data set with 70 observations, but the output is ''Warning message:'' Warning message: In chisq.test(tabele) : Chi-squared approximation may be incorrect Here is an example:         tabele - matrix(c(11, 3, 3, 18, 3, 6, 5, 21), ncol

Re: [R] chisq.test

2012-06-26 Thread Peter Ehlers
On 2012-06-26 11:27, Omphalodes Verna wrote: Dear list! I would like to calculate chisq.test on simple data set with 70 observations, but the output is ''Warning message:'' Warning message: In chisq.test(tabele) : Chi-squared approximation may be incorrect Here is an example:

Re: [R] chisq.test

2012-06-26 Thread David L Carlson
Sent: Tuesday, June 26, 2012 1:28 PM To: r-help@r-project.org Subject: [R] chisq.test Dear list! I would like to calculate chisq.test on simple data set with 70 observations, but the output is ''Warning message:'' Warning message: In chisq.test(tabele) : Chi-squared approximation may

Re: [R] chisq.test

2012-06-26 Thread David Winsemius
On Jun 26, 2012, at 2:27 PM, Omphalodes Verna wrote: Dear list! I would like to calculate chisq.test on simple data set with 70 observations, but the output is ''Warning message:'' Warning message: In chisq.test(tabele) : Chi-squared approximation may be incorrect Here is an example:

Re: [R] chisq.test

2012-06-26 Thread arun
To: r-help@r-project.org r-help@r-project.org Cc: Sent: Tuesday, June 26, 2012 2:27 PM Subject: [R] chisq.test Dear list! I would like to calculate chisq.test on simple data set with 70 observations, but the output is ''Warning message:'' Warning message: In chisq.test(tabele) : Chi-squared

Re: [R] chisq.test

2012-06-26 Thread Rolf Turner
omphalodes.ve...@yahoo.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Tuesday, June 26, 2012 2:27 PM Subject: [R] chisq.test Dear list! I would like to calculate chisq.test on simple data set with 70 observations, but the output is ''Warning message:'' Warning message: In chisq.test

[R] chisq.test vs manual calculation - why are different results produced?

2012-02-20 Thread Louise Mair
Hello, I am trying to fit gamma, negative exponential and inverse power functions to a dataset, and then test whether the fit of each curve is good. To do this I have been advised to calculate predicted values for bins of data (I have grouped a continuous range of distances into 1km bins), and

Re: [R] chisq.test vs manual calculation - why are different results produced?

2012-02-20 Thread David Winsemius
On Feb 20, 2012, at 5:57 AM, Louise Mair wrote: Hello, I am trying to fit gamma, negative exponential and inverse power functions to a dataset, and then test whether the fit of each curve is good. To do this I have been advised to calculate predicted values for bins of data (I have

Re: [R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-20 Thread peter dalgaard
On Aug 19, 2011, at 20:40 , David Winsemius wrote: On Aug 19, 2011, at 1:28 PM, Stephen Davies wrote: I'm using chisq.test() on a matrix of categorical data, and I see that the residuals attribute of the returned object will give me the Pearson residuals. That's cool. However, what I'd

Re: [R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-20 Thread David Winsemius
On Aug 20, 2011, at 3:43 AM, peter dalgaard wrote: On Aug 19, 2011, at 20:40 , David Winsemius wrote: On Aug 19, 2011, at 1:28 PM, Stephen Davies wrote: I'm using chisq.test() on a matrix of categorical data, and I see that the residuals attribute of the returned object will give me the

Re: [R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-20 Thread Stephen Davies
I'm using chisq.test() on a matrix of categorical data, and I see that the residuals attribute of the returned object will give me the Pearson residuals. Actually they are not an attribute in the R sense, but rather a list value. Oh. I was just going by:

Re: [R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-20 Thread David Winsemius
On Aug 20, 2011, at 12:04 PM, Stephen Davies wrote: I'm using chisq.test() on a matrix of categorical data, and I see that the residuals attribute of the returned object will give me the Pearson residuals. Actually they are not an attribute in the R sense, but rather a list value. Oh.

Re: [R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-20 Thread peter dalgaard
On Aug 20, 2011, at 18:04 , Stephen Davies wrote: As for $stdres, that would be wonderful, but as you can see from the above list of attributes, it's not one of the 8 returned. What am I missing? An upgrade, most likely. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen

Re: [R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-20 Thread David Winsemius
On Aug 20, 2011, at 12:57 PM, peter dalgaard wrote: On Aug 20, 2011, at 18:04 , Stephen Davies wrote: As for $stdres, that would be wonderful, but as you can see from the above list of attributes, it's not one of the 8 returned. What am I missing? An upgrade, most likely. Whoosh.

[R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-19 Thread Stephen Davies
I'm using chisq.test() on a matrix of categorical data, and I see that the residuals attribute of the returned object will give me the Pearson residuals. That's cool. However, what I'd really like is the standardized (adjusted) Pearson residuals, which have a N(0,1) distribution. Is there a way to

Re: [R] chisq.test(): standardized (adjusted) Pearson residuals

2011-08-19 Thread David Winsemius
On Aug 19, 2011, at 1:28 PM, Stephen Davies wrote: I'm using chisq.test() on a matrix of categorical data, and I see that the residuals attribute of the returned object will give me the Pearson residuals. That's cool. However, what I'd really like is the standardized (adjusted) Pearson

[R] chisq.test and cbind

2011-03-13 Thread Simone Santoro
Hi, This is a mixed conceptual/methodological issue. I have 3 years and 2 localities, I want to compare the Sex Ratio series between the two localities. I can do it year by year, for instance: SR2010-data.frame(FAO=c(96,52),JUNC=c(60,42)) SR2010 FAO JUNC 1 96 60 2 52 42

[R] chisq.test on samples of different lengths

2010-08-24 Thread Marino Taussig De Bodonia, Agnese
Hello, I am trying to see whether there has been a significant difference in whether people experienced damages from wildlife in two different years. I therefore have two columns: year 1: yes no no no yes yes no year 2: no yes no yes I wanted to do a chisq.test, but if I enter it this way:

Re: [R] chisq.test on samples of different lengths

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 10:12 AM, Marino Taussig De Bodonia, Agnese wrote: Hello, I am trying to see whether there has been a significant difference in whether people experienced damages from wildlife in two different years. I therefore have two columns: year 1: yes no no no yes yes no

Re: [R] chisq.test on samples of different lengths

2010-08-24 Thread peter dalgaard
On Aug 24, 2010, at 4:12 PM, Marino Taussig De Bodonia, Agnese wrote: Hello, I am trying to see whether there has been a significant difference in whether people experienced damages from wildlife in two different years. I therefore have two columns: year 1: yes no no no yes yes

[R] chisq.test: decreasing p-value

2009-03-11 Thread soeren . vogel
A Likert scale may have produced counts of answers per category. According to theory I may expect equality over the categories. A statistical test shall reveal the actual equality in my sample. When applying a chi square test with increasing number of repetitions (simulate.p.value) over a

Re: [R] chisq.test: decreasing p-value

2009-03-11 Thread Peter Dalgaard
soeren.vo...@eawag.ch wrote: A Likert scale may have produced counts of answers per category. According to theory I may expect equality over the categories. A statistical test shall reveal the actual equality in my sample. When applying a chi square test with increasing number of repetitions

Re: [R] chisq.test: decreasing p-value

2009-03-11 Thread David Winsemius
On Mar 11, 2009, at 6:36 AM, soeren.vo...@eawag.ch wrote: A Likert scale may have produced counts of answers per category. According to theory I may expect equality over the categories. A statistical test shall reveal the actual equality in my sample. When applying a chi square test with

Re: [R] chisq.test: decreasing p-value

2009-03-11 Thread David Winsemius
Thanks to Peter Dalgaard for the correct answer. I misinterpreted what R was returning. On Mar 11, 2009, at 7:32 AM, David Winsemius wrote: On Mar 11, 2009, at 6:36 AM, soeren.vo...@eawag.ch wrote: A Likert scale may have produced counts of answers per category. According to theory I

Re: [R] chisq.test: decreasing p-value

2009-03-11 Thread soeren . vogel
Thanks to Peter, David, and Michael! After having corrected the coding error, the p values converge to particular value, not necessarily zero. The whole story is, 634 respondents in 6 different areas marked their answer on a 7-step Likert scale (very bad, bad, ..., very good -- later

[R] chisq.test in batch

2007-10-11 Thread João Fadista
Dear all, I would like to compute hundreds of chisq.test ´s, and for each test output I would like to extract only the p-values. So my question is: how can I make this without making it manually? Example: # Test nº1 chisq.test(c(220,240)) Chi-squared test for given