Skip to main content

Solution Manual For Lab Manual for Social Science Statistics Using R, 1st Edition by Brian Joseph Gi

Page 1

Solution Manual For Social Science Statistics Using R, 1st Edition by Brian Joseph Gillespie and Kathleen Charli Hibbert Chapters 1-9 Chapter 1 Lab Assignment 1 (Answers) 1. Access the “spreadsheet” format of the scripting window and answer questions about the following respondents in the dataset: a. What is the age (age) of respondent 1208? 33 b. How many siblings (sibs) does respondent 323 have? 19 c. Respondent 1291 has a value of “9” for the variable sexornt. What does this mean? (Hint—you will need to refer to the codebook). A value of “9” for the variable sexornt indicates that the respondent refused to answer. d. What value would be recorded in the data if a respondent reported that they attend religious services (attend) “several times a year”? (Again, you will need to use the codebook to answer this question). The value “3” for the variable attend indicates that a respondent attends religious services several times a year. 2. Download and attach the package effsize. Based on the package‟s documentation, what statistics are computed with this package? The effsize package contains functions to compute various effect sizes, including Cohen‟s d, Hedges‟ d, and Cliff‟s Delta. 3. Using the GSS Codebook, find the variable quallife and answer the following questions: a. What survey question was asked to produce the data for this variable? The question was: “In general, would you say that your quality of life is…” with a series of response options ranging from excellent (1) to poor (5). b. In what year was this question first asked in the GSS? This question was first asked in the GSS in 2018. c. If the dataset has a value “4” for a respondent on this variable, what does this indicate? A value of “4” indicates that a respondent reported their quality of life is “fair.” d. What code(s) would be used if a person reported that they did not know the answer or they did not provide an answer? The value “8” means that a respondent “don‟t know” their quality of life and “9” is used to indicate that no answer was provided. Chapter 2 Lab Assignment 2 (Answers)


1. Recode the quantitative variable partners into the following dichotomous variable: 0 1-9 NA/DK

0 Partners 1+ Partners “NA”

GSS2018$partnersrec No Sex in 12 Months Sex This Year NA's Total

Frequency Percent Valid Percent 358 15.25 25.66 1037 44.17 74.34 953 40.59 2348 100.00 100.00

Produce a frequencies table (with variable labels) for the dichotomous variable.  What does this newly-coded variable measure? The recoded variable indicates whether or not an individual has had any sexual partners within the last 12 months.  Why is it important to first recode the missing values before making a dichotomous variable? Missing values should be recoded to “NA” first so that they are not interpreted as being a meaningful number of sexual partners.  What would happen if we did not recode the missing values before recoding the actual values? Individuals who do not provide an answer receive a value of “99.” If this is not recoded to “NA” first, the “99” would instead be recoded to “1,” which is not an accurate representation of whether the respondent had any sexual partners in the last 12 months. 2. Recode the variable tvhours into tvhrsrec. Use any recoding classification but be sure to describe your rationale for recoding it this way. Produce a frequencies table for the new variable with value labels based on your recoding schema. GSS2018$tvhrsrec Frequency Percent Valid Percent None/Low 349 14.864 24.75 Some 885 37.692 62.77 A Lot 176 7.496 12.48 NA's 938 39.949 Total 2348 100.000 100.00 Cutoff decisions for recoding will vary but often include: (a) personal interpretations of what amount of television watching is low, moderate, and high or (b) the relative breakdown of frequencies for the original variable. For example, tvhours frequencies seem to drop off after about 5 hours, so those values are recoded to reflect “a lot” compared with the other respondents in the data.


3. Using the variables teensex and premarsx, create a composite measure of “sexual permissiveness” where higher scores on the measure will indicate more permissive attitudes about sexual activity. a. Produce a table of frequencies for your results—be sure to mark the vector as “ordered” so it will be recognized as an ordinal variable. b. What other measures in the GSS 2018 might help tap into this construct? GSS2018$sexpermissive 2 3 4 5 6 7 8 NA's Total

Frequency Percent Valid Percent Cum Percent 269 11.457 17.803 17.80 77 3.279 5.096 22.90 158 6.729 10.457 33.36 439 18.697 29.054 62.41 230 9.796 15.222 77.63 215 9.157 14.229 91.86 123 5.239 8.140 100.00 837 35.647 2348 100.000 100.000

Other variables that might enhance this composite measure refer to individuals‟ opinions about same-sex sexual activity (homosex) and sex with someone other than one‟s spouse (xmarsex). Depending on the breadth of the measure/study, it could also include individuals‟ perspectives on pornography (e.g., pornlaw and xmovie) or behavioral measures that tap into individuals‟ sex frequency (sexfreq) and number of sexual partners (partners).

Chapter 3 Lab Assignment 3 (Answers) 1. Review the codebook entries for the following variables: health (p. 392), satfin (p. 457), and hompop (p. 212). Recode the missing values to “NA” and generate frequency tables with cumulative percentages for each. Briefly summarize the results. healthrec Excellent Good Fair Poor NA's Total

Frequency Percent Valid Percent Cum Percent 359 15.290 22.881 22.88 771 32.836 49.140 72.02 355 15.119 22.626 94.65 84 3.578 5.354 100.00 779 33.177 2348 100.000 100.000

Mode(GSS2018$healthrec, na.rm = TRUE)


[1] Good attr(,"freq") [1] 771 Levels: Excellent < Good < Fair < Poor Median(GSS2018$healthrec, na.rm = TRUE) [1] Good Levels: Excellent < Good < Fair < Poor

satfinrec Pretty Well More or Less Not at All NA's Total

Frequency Percent Valid Percent Cum Percent 737 31.3884 31.52 31.52 1047 44.5911 44.78 76.30 554 23.5945 23.70 100.00 10 0.4259 2348 100.0000 100.00

Mode(GSS2018$satfinrec, na.rm = TRUE) [1] More or Less attr(,"freq") [1] 1047 Levels: Pretty Well < More or Less < Not at All Median(GSS2018$satfinrec, na.rm = TRUE) [1] More or Less Levels: Pretty Well < More or Less < Not at All hompoprec 1 2 3 4 5 6 7 8 9 10 11 Total

Frequency Percent 669 28.49233 890 37.90460 342 14.56559 287 12.22317 105 4.47189 32 1.36286 12 0.51107 5 0.21295 3 0.12777 1 0.04259 2 0.08518 2348 100.00000

Mode(GSS2018$hompoprec, na.rm = TRUE) [1] 2 attr(,"freq") [1] 890 Median(GSS2018$hompoprec, na.rm = TRUE) [1] 2 GSS2018$hompoprec (numeric) length

n

NAs

unique

0s

mean

meanCI'


2'348

2'348 100.0%

0 0.0%

11

0 0.0%

2.35

2.30 2.41

.05 1.00

.10 1.00

.25 1.00

median 2.00

.75 3.00

.90 4.00

.95 5.00

range 10.00

sd 1.33

vcoef 0.57

mad 1.48

IQR 2.00

skew 1.42

kurt 3.24

2. Consider the variables in the table below. Complete any necessary data management and fill in the appropriate measures of central tendency and dispersion. Mark “X” if the cell in the table is not applicable. Variables Book Section polabuse Chapter Exercise 2.6 abfull Demonstration 2.7 sexrec Demonstration 2.2 agerec Chapter Exercise 2.3

Mean 1.8 4.6 X X

Median 2 5 X Adult

Mode 2 7 Female Adult

Range 4 7 X X

SD 0.9 2.5 X X

IQR 1 4 X X

Note: These variables were developed and transformed in earlier chapters. The column “Book Section” indicates where these recoded measures can be found. Chapter 4 Lab Assignment 4 (Answers) 1. Generate a vertical bar chart for the variable agerec, which was generated in Demonstration 2.3—use different specifications of your choice:


Turn static files into dynamic content formats.

Create a flipbook
Solution Manual For Lab Manual for Social Science Statistics Using R, 1st Edition by Brian Joseph Gi by AnswerDone - Issuu