Skip to content

Contingency tables example

8 messages · Steve_Friedman at nps.gov, sambooth21, VictorDelgado +2 more

#
I have this question:

http://r.789695.n4.nabble.com/file/n4240145/data%5D.jpg 

This table and data represents a sample of social housing residents in
Copenhagen and I'm asked to analyse the data with a view to seeing what
might be related to residents satisfaction levels.

And I just don't know where to start, if anyone could help this would be
greatly appreciated  

Regards


Sam


--
View this message in context: http://r.789695.n4.nabble.com/Contingency-tables-example-tp4240145p4240145.html
Sent from the R help mailing list archive at Nabble.com.
#
This is a elementary problem concerned with tests of association.  You
should read up on  categorical statistics,  chi square tests, and general
linear models.


Steve Friedman Ph. D.
Ecologist  / Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034

Steve_Friedman at nps.gov
Office (305) 224 - 4282
Fax     (305) 224 - 4147


                                                                           
             sambooth21                                                    
             <smb1g09 at soton.ac                                             
             .uk>                                                       To 
             Sent by:                  r-help at r-project.org                
             r-help-bounces at r-                                          cc 
             project.org                                                   
                                                                   Subject 
                                       [R] Contingency tables example      
             12/28/2011 10:20                                              
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           




I have this question:

http://r.789695.n4.nabble.com/file/n4240145/data%5D.jpg

This table and data represents a sample of social housing residents in
Copenhagen and I'm asked to analyse the data with a view to seeing what
might be related to residents satisfaction levels.

And I just don't know where to start, if anyone could help this would be
greatly appreciated

Regards


Sam


--
View this message in context:
http://r.789695.n4.nabble.com/Contingency-tables-example-tp4240145p4240145.html

Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
#
On Dec 28, 2011, at 12:48 PM, Steve_Friedman at nps.gov wrote:
Steven:

Why are you sending copies to r-help-bounces????? Do you think the  
moderators need an extra copy?
Along those lines, Thompson's "R accompaniment" to Agresti's text on  
"Categorical Data Analysis" is simply wonderful:

https://home.comcast.net/~lthompson221/SplusDiscrete.PDF

It's not surprising that Agresti recommends it on the book's homepage:
http://www.stat.ufl.edu/~aa/cda/cda.html

However, I suspect the OP might be better off with Agresti's "An  
Introduction to Categorical Data Analysis (2nd ed. 2007)". So perhaps  
following the link on Agresti's page to the linked and  website could  
be a first visit for worked R code examples. But when I followed that  
link I didn't find much that seemed appropriate for a beginner in R.  
Maybe looking at Friendly's website which was in the links at Bilder's  
site:

http://www.datavis.ca/courses/grcat/

-- 
David.
#
I am having a few problems importing the data i'm running this code and the
table sets up fine but all of the data values say NA:

housdat<- c(21, 21, 28, 14, 19, 37, 34, 22, 36, 17, 23, 401, 10, 11, 36, 3,
5, 23, 61, 23, 17, 78, 46, 43, 43, 35, 40, 48, 45, 86, 26, 18, 54, 15, 25,
62)
housdat<-array(dim=c(2,3,6))
dimnames(housdat) <- list(Housing=c("Tower Block","Apartment"),
Influence=c("Low","Medium","High"),
ContactSatisfaction=c("LCLow","LCMed","LCHigh","HCLow","HCMed","HCHigh"))

ftable(housdat, row.vars=c("Housing","Influence"),
col.vars="ContactSatisfaction")

any advice would be greatly appreciated!

--
View this message in context: http://r.789695.n4.nabble.com/Contingency-tables-example-tp4240145p4242575.html
Sent from the R help mailing list archive at Nabble.com.
#
sambooth21 wrote
Try this:

housdat<-array(housdat,dim=c(2,3,6))

Pay attention to some values that do you have inserted. Maybe you can fix it
using:

fix(housdat)

-----
Victor Delgado
cedeplar.ufmg.br P.H.D. student
www.fjp.mg.gov.br reseacher
--
View this message in context: http://r.789695.n4.nabble.com/Contingency-tables-example-tp4240145p4242873.html
Sent from the R help mailing list archive at Nabble.com.
#
sambooth21 wrote
look for ?anova

-----
Victor Delgado
cedeplar.ufmg.br P.H.D. student
www.fjp.mg.gov.br reseacher
--
View this message in context: http://r.789695.n4.nabble.com/Contingency-tables-example-tp4240145p4242882.html
Sent from the R help mailing list archive at Nabble.com.
#
On Dec 29, 2011, at 7:15 AM, sambooth21 wrote:

            
Rhelp is NOT a homework help list. If you are a student, as you give  
every appearance of being, then you should be seeking help through  
your usual academic channels. This dataset regarding Copenhageners'  
satisfaction with housing conditions from 30 or 40 years ago is widely  
copied in a variety of textbooks and websites, (including R's own MASS  
where its name is 'housing').
#
Without giving help on a potential homework problem, I would suggest
that after each step you examine the object you are
creating/modifying.  This is a basic debugging technique that will
help you out in the future.  If you have a multi-step problem (as
almost all are), then you may have to go step-by-step and track down
when the problem is.  It should be obvious where your problem is if
you follow these instructions.

On Thu, Dec 29, 2011 at 12:10 PM, David Winsemius
<dwinsemius at comcast.net> wrote: