SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Table 6.18 shows results from the 2000 General Social Survey relating happiness and religious
attendance (1 = at most several times a year, 2 = once a month to several times a year, 3 = every
week to several times a week). a. Fit a multinomial model. Conduct descriptive and inferential
analyses about the association. b. Analyze the model goodness of fit.
Solution
summary(gsSurvey$happy)
table(gsSurvey$happy)
help(table)
table(gsSurvey$happy, useNA="ifany")
table(gsSurvey$religion, useNA="ifany")
table(gsSurvey$religion, useNA="always")
table(gsSurvey$happy, gsSurvey$religion, useNA="ifany")
ggfluctuation(table(gsSurvey$happy, gsSurvey$religion, useNA="ifany"))
table(gsSurvey$happy, gsSurvey$health, useNA="ifany")
ggfluctuation(table(gsSurvey$happy, gsSurvey$health, useNA="ifany"))
library(productplots)
prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine"))
## depends very much on ordering of levels
gsSurvey$health <- factor(gsSurvey$health, levels=c("1", "2", "3"))
gsSurvey$happy <- factor(gsSurvey$happy, levels=c("VERY HAPPY","PRETTY
HAPPY","NOT TOO HAPPY"))
prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine")) + aes(fill=happy)
levels(gsSurvey$happy) <- c("VERY HAPPY","PRETTY HAPPY","NOT TOO HAPPY")
levels(gsSurvey$health) <- c("1", "2", "3")
prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine")) + aes(fill=happy)
prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine"), na.rm=T) + aes(fill=happy)
Table 6-18 shows results from the 2000 General Social Survey relating.docx

Weitere ähnliche Inhalte

Mehr von william842

The -meta charset-utf-8- element specifies what scheme the web page us.docx
The -meta charset-utf-8- element specifies what scheme the web page us.docxThe -meta charset-utf-8- element specifies what scheme the web page us.docx
The -meta charset-utf-8- element specifies what scheme the web page us.docxwilliam842
 
Sustainability is an important ethical and environmental issue in purc.docx
Sustainability is an important ethical and environmental issue in purc.docxSustainability is an important ethical and environmental issue in purc.docx
Sustainability is an important ethical and environmental issue in purc.docxwilliam842
 
Thank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docx
Thank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docxThank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docx
Thank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docxwilliam842
 
class is intro to computers - studying environmental studies and law e.docx
class is intro to computers - studying environmental studies and law e.docxclass is intro to computers - studying environmental studies and law e.docx
class is intro to computers - studying environmental studies and law e.docxwilliam842
 
Common Stock Dividends Distributable is reported in the balance sheet-.docx
Common Stock Dividends Distributable is reported in the balance sheet-.docxCommon Stock Dividends Distributable is reported in the balance sheet-.docx
Common Stock Dividends Distributable is reported in the balance sheet-.docxwilliam842
 
column on the pericol tabie iOus Ciou f States that the properties of.docx
column on the pericol tabie iOus Ciou f States that the properties of.docxcolumn on the pericol tabie iOus Ciou f States that the properties of.docx
column on the pericol tabie iOus Ciou f States that the properties of.docxwilliam842
 
Coby has been working on a research paper about poverty in America- In.docx
Coby has been working on a research paper about poverty in America- In.docxCoby has been working on a research paper about poverty in America- In.docx
Coby has been working on a research paper about poverty in America- In.docxwilliam842
 
Cloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docx
Cloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docxCloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docx
Cloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docxwilliam842
 
Clint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docx
Clint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docxClint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docx
Clint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docxwilliam842
 
Cleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docx
Cleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docxCleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docx
Cleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docxwilliam842
 
Classify each of the compounds as Soluble (s) or Not Soluble (ns)-.docx
Classify each of the compounds as Soluble (s) or Not Soluble (ns)-.docxClassify each of the compounds as Soluble (s) or Not Soluble (ns)-.docx
Classify each of the compounds as Soluble (s) or Not Soluble (ns)-.docxwilliam842
 
Choose the statement below that is TRUE- Choose the statement below th.docx
Choose the statement below that is TRUE- Choose the statement below th.docxChoose the statement below that is TRUE- Choose the statement below th.docx
Choose the statement below that is TRUE- Choose the statement below th.docxwilliam842
 
Choose the correct format for a journal article with a DOI and more th.docx
Choose the correct format for a journal article with a DOI and more th.docxChoose the correct format for a journal article with a DOI and more th.docx
Choose the correct format for a journal article with a DOI and more th.docxwilliam842
 
Choose one of the transition or inner transition metals from the perio.docx
Choose one of the transition or inner transition metals from the perio.docxChoose one of the transition or inner transition metals from the perio.docx
Choose one of the transition or inner transition metals from the perio.docxwilliam842
 
Choices Pointer Arithmetic Dynamic Memory allocation and deal location.docx
Choices Pointer Arithmetic Dynamic Memory allocation and deal location.docxChoices Pointer Arithmetic Dynamic Memory allocation and deal location.docx
Choices Pointer Arithmetic Dynamic Memory allocation and deal location.docxwilliam842
 
CHEM 464 Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docx
CHEM 464  Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docxCHEM 464  Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docx
CHEM 464 Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docxwilliam842
 
Chem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docx
Chem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docxChem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docx
Chem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docxwilliam842
 
Chem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docx
Chem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docxChem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docx
Chem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docxwilliam842
 

Mehr von william842 (18)

The -meta charset-utf-8- element specifies what scheme the web page us.docx
The -meta charset-utf-8- element specifies what scheme the web page us.docxThe -meta charset-utf-8- element specifies what scheme the web page us.docx
The -meta charset-utf-8- element specifies what scheme the web page us.docx
 
Sustainability is an important ethical and environmental issue in purc.docx
Sustainability is an important ethical and environmental issue in purc.docxSustainability is an important ethical and environmental issue in purc.docx
Sustainability is an important ethical and environmental issue in purc.docx
 
Thank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docx
Thank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docxThank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docx
Thank you- Let Phi- R rightarrow S be a surjective homomorphism from t.docx
 
class is intro to computers - studying environmental studies and law e.docx
class is intro to computers - studying environmental studies and law e.docxclass is intro to computers - studying environmental studies and law e.docx
class is intro to computers - studying environmental studies and law e.docx
 
Common Stock Dividends Distributable is reported in the balance sheet-.docx
Common Stock Dividends Distributable is reported in the balance sheet-.docxCommon Stock Dividends Distributable is reported in the balance sheet-.docx
Common Stock Dividends Distributable is reported in the balance sheet-.docx
 
column on the pericol tabie iOus Ciou f States that the properties of.docx
column on the pericol tabie iOus Ciou f States that the properties of.docxcolumn on the pericol tabie iOus Ciou f States that the properties of.docx
column on the pericol tabie iOus Ciou f States that the properties of.docx
 
Coby has been working on a research paper about poverty in America- In.docx
Coby has been working on a research paper about poverty in America- In.docxCoby has been working on a research paper about poverty in America- In.docx
Coby has been working on a research paper about poverty in America- In.docx
 
Cloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docx
Cloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docxCloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docx
Cloud Computing Theory and Practice chapter 2 problem 7 Tuple-spaces c.docx
 
Clint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docx
Clint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docxClint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docx
Clint is Marilyn-'s supervisor- Marilyn is a dedicated part-time emplo.docx
 
Cleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docx
Cleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docxCleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docx
Cleary- Wasser- and Nolan formed a partnership on January 1- 2010- wit.docx
 
Classify each of the compounds as Soluble (s) or Not Soluble (ns)-.docx
Classify each of the compounds as Soluble (s) or Not Soluble (ns)-.docxClassify each of the compounds as Soluble (s) or Not Soluble (ns)-.docx
Classify each of the compounds as Soluble (s) or Not Soluble (ns)-.docx
 
Choose the statement below that is TRUE- Choose the statement below th.docx
Choose the statement below that is TRUE- Choose the statement below th.docxChoose the statement below that is TRUE- Choose the statement below th.docx
Choose the statement below that is TRUE- Choose the statement below th.docx
 
Choose the correct format for a journal article with a DOI and more th.docx
Choose the correct format for a journal article with a DOI and more th.docxChoose the correct format for a journal article with a DOI and more th.docx
Choose the correct format for a journal article with a DOI and more th.docx
 
Choose one of the transition or inner transition metals from the perio.docx
Choose one of the transition or inner transition metals from the perio.docxChoose one of the transition or inner transition metals from the perio.docx
Choose one of the transition or inner transition metals from the perio.docx
 
Choices Pointer Arithmetic Dynamic Memory allocation and deal location.docx
Choices Pointer Arithmetic Dynamic Memory allocation and deal location.docxChoices Pointer Arithmetic Dynamic Memory allocation and deal location.docx
Choices Pointer Arithmetic Dynamic Memory allocation and deal location.docx
 
CHEM 464 Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docx
CHEM 464  Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docxCHEM 464  Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docx
CHEM 464 Biochemistry I Summer 2018 Homework 4- Upload file(s) to D2L.docx
 
Chem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docx
Chem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docxChem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docx
Chem 166 (185) Research Project (Week 9)- Synthesis of a Phenothiazine.docx
 
Chem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docx
Chem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docxChem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docx
Chem 107 Test 1 Pnge 3 14- Idenaify the following as lemets or comp a).docx
 

Kürzlich hochgeladen

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Kürzlich hochgeladen (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Table 6-18 shows results from the 2000 General Social Survey relating.docx

  • 1. Table 6.18 shows results from the 2000 General Social Survey relating happiness and religious attendance (1 = at most several times a year, 2 = once a month to several times a year, 3 = every week to several times a week). a. Fit a multinomial model. Conduct descriptive and inferential analyses about the association. b. Analyze the model goodness of fit. Solution summary(gsSurvey$happy) table(gsSurvey$happy) help(table) table(gsSurvey$happy, useNA="ifany") table(gsSurvey$religion, useNA="ifany") table(gsSurvey$religion, useNA="always") table(gsSurvey$happy, gsSurvey$religion, useNA="ifany") ggfluctuation(table(gsSurvey$happy, gsSurvey$religion, useNA="ifany")) table(gsSurvey$happy, gsSurvey$health, useNA="ifany") ggfluctuation(table(gsSurvey$happy, gsSurvey$health, useNA="ifany")) library(productplots) prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine")) ## depends very much on ordering of levels gsSurvey$health <- factor(gsSurvey$health, levels=c("1", "2", "3")) gsSurvey$happy <- factor(gsSurvey$happy, levels=c("VERY HAPPY","PRETTY HAPPY","NOT TOO HAPPY")) prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine")) + aes(fill=happy) levels(gsSurvey$happy) <- c("VERY HAPPY","PRETTY HAPPY","NOT TOO HAPPY") levels(gsSurvey$health) <- c("1", "2", "3") prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine")) + aes(fill=happy) prodplot(data=gsSurvey, ~happy+health, c("vspine", "hspine"), na.rm=T) + aes(fill=happy)