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) c(c(tail(

Re: [R] chisq.test

2012-06-27 Thread Omphalodes Verna
Dear all! Thanks for clarification. OV To: Rolf Turner 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 .org> Sent: Wednesday, J

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 Turner 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

Re: [R] chisq.test

2012-06-26 Thread John
On Wed, 27 Jun 2012 16:58:29 +1200 Rolf Turner 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 all be at lea

Re: [R] chisq.test

2012-06-26 Thread Rolf Turner
odes Verna To: "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 chi

Re: [R] chisq.test

2012-06-26 Thread arun
roject.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-square

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 David L Carlson
halodes Verna > 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:'

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: tab

[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), nco

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 group

[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 the

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. So

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: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 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 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 th

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. Howev

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

[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 t

[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 >

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

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 year

[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: c

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 recode

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 may

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 i

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 repetit

[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 f

Re: [R] chisq.test in batch

2007-10-11 Thread Ted Harding
On 11-Oct-07 22:11:46, João Fadista wrote: > 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? ?chisq.test (under "Value") tells you that one

[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 probabilit