[R] Rcommander and simple chisquare

John Fox jfox at mcmaster.ca
Thu Sep 15 18:59:11 CEST 2005


Dear Christian,

The Rcmdr assumes that you have a data frame with the original data, in
which the variable in question is a factor. The frequency distribution is
constructed for the factor. Thus, in your example, you'd have 100
observations classified on a two-category factor. What you enter directly
are the hypothesized probabilities.

I hope this helps,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
-------------------------------- 

> -----Original Message-----
> From: Christian Jost [mailto:jost at cict.fr] 
> Sent: Thursday, September 15, 2005 11:38 AM
> To: John Fox; 'Philippe Grosjean'
> Cc: r-help at stat.math.ethz.ch
> Subject: RE: [R] Rcommander and simple chisquare
> 
> Dear John and Philippe,
> 
> thanks for your replys, I finally  found this menu, but I am 
> somewhat at a loss how I should enter the observed 
> frequencies. To take my example below, If I enter a 
> one-column data.frame with the numbers 61 and 39, John's 
> indicated menu is not highlighted. If I add a second column 
> containing some factor, the menu is highlighted by I cannot 
> select the first column. However, if I edit the data and 
> declare the first column to be of type 'character' I can 
> select it in the menu dialog and declare the expected 
> frequencies, but the chisquare output doesn't make any sense. 
> For the moment I cannot make any sense of that :-( Any help 
> most appreciated, or a link to the tutorial/faq that explains 
> such kind of problems.
> 
> Thanks, Christian.
> 
> At 11:31 -0400 15/09/05, John Fox wrote:
> >Dear Philippe,
> >
> >This does a chi-square test of independence in a contingency 
> table, not 
> >a chi-square goodness-of-fit test (which is done in the Rcmdr via 
> >Statistics
> >-> Summaries -> Frequency distribution).
> >
> >Regards,
> >  John
> >
> >--------------------------------
> >John Fox
> >Department of Sociology
> >McMaster University
> >Hamilton, Ontario
> >Canada L8S 4M4
> >905-525-9140x23604
> >http://socserv.mcmaster.ca/jfox
> >--------------------------------
> >
> >>  -----Original Message-----
> >>  From: r-help-bounces at stat.math.ethz.ch  
> >> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of  Philippe 
> >> Grosjean
> >>  Sent: Thursday, September 15, 2005 7:32 AM
> >>  To: Christian Jost
> >>  Cc: r-help at stat.math.ethz.ch
> >>  Subject: Re: [R] Rcommander and simple chisquare
> >>
> >>  Hello,
> >>
> >>  Just look at Statistics -> Contingency tables. There is 
> an  option 
> >> for making the chi square test there.
> >>  Best,
> >>
> >>  Philippe Grosjean,
> >>
> >>  ..............................................<°}))><........
> >>    ) ) ) ) )
> >  > ( ( ( ( (    Prof. Philippe Grosjean
> >  > ..............................................................
> >>
> >>  Christian Jost wrote:
> >>  > In this years biostat teaching I will include Rcommander (it 
> >> indeed  > simplifies syntax problems that makes students 
> frequently 
> >> miss the  > core statistical problems). But I could not 
> find how to  
> >> make a simple  > chisquare comparison between observed frequencies 
> >> and expected  > frequencies (eg in genetics where you expect 
> >> phenotypic frequencies  > corresponding to 3:1 in standard 
> >> dominant/recessif  alleles). Any idea  > where this 
> feature might be 
> >> hidden? Or could it be added to  > Rcommander?
> >>  >
> >>  > Thanks, Christian.
> >>  >
> >>  > ps: in case I am not making myself clear, can 
> Rcommander be made 
> >> to  > perform  >  >> chisq.test(c(61,39),p=c(0.75,0.25))
> >>  >
> >>  >
> >  > > ______________________________________________
>




More information about the R-help mailing list