Let us worry about your assignment instead!

We Helped With This Statistics with R Programming Homework: Have A Similar One?

SOLVED
CategoryProgramming
SubjectR | R Studio
DifficultyCollege
StatusSolved
More InfoStatistics Homework Help
89991

Short Assignment Requirements

​READ ATTACHMENT FOR COMPLETE INFOlook at attachment requires R studio. You are also required to submit your R syntax (the code) as an Appendix, so be sure to do all of your work in the R script, not in the Console.[1] Please label your R syntax by question number, too, so that it can be matched to the test question (use the # to add text to your script, or add it to the Appendix later).Required parts of submission document:Answers (includes tables and figures)R syntax (Appendix)Integrity statement

Assignment Description

2017-2018

POL 242Y5Y    Methods

 

Test #2

Due January 4 by 11am

 

 

 

OVERVIEW

The take-home examination is designed to test your understanding of research logic, R programming basics, data visualizing, tables and cross tabulations, and interpretation of bivariate hypothesis tests (with and without controls). You will need access to R Studio and an internet connection. The test is to be completed independently (no collaboration with peers).

 

INSTRUCTIONS

This test is not a collaborative exercise; it is to be completed independent of assistance or guidance form others. You should, however, use all of the resources that you have access to, especially those found online, if they are needed. Answer all questions in a separate Word document. Be sure to appropriately label your question numbers (1a., 1b., etc.). Include in your test document the Integrity statement, which confirms that the work is your own, independently done.

 

You are also required to submit your R syntax (the code) as an Appendix, so be sure to do all of your work in the R script, not in the Console.[1] Please label your R syntax by question number, too, so that it can be matched to the test question (use the # to add text to your script, or add it to the Appendix later).

 

When you are done, save the documents in one single file (Word or PDF are okay) and upload it to Blackboard at the appropriate location before class (11am) on January 4, 2018. No extensions will be granted except in cases of provable emergency, such as hospitalization of you or an immediate family (household) member.

 

Required parts of submission document:

i.                     Answers (includes tables and figures)

ii.                   R syntax (Appendix)

iii.                 Integrity statement

 

 

 

 

 

USING THE ‘POLISCI’ PACKAGE

You arent required to download any datasets for this assignment. Instead, you will use custom datasets from the poliscidata package.

 

First, you’ll need to install R Studio on your machine. (See the R Studio web site to download it for free[2]), if you haven’t already installed it. Then, download and install the poliscidata package:

 

install.packages("poliscidata")

 

Finally, load the package:

 

library(poliscidata)            

 

The poliscidata package has three datasets which you will use to complete the test. [3] Note: As these are prepackaged datasets, they will not load in the R “Environment” at the top right like data does when you load it from a web link or your computer. Don’t worry, the data are loaded and will appear if you call it. Datasets will appear in the Environment if you subset new dataset from the originals.

 

gss. This dataset has selected variables from the 2012 General Social Survey, a random sample of 1,974 adults aged 18 years or older, conducted by the National Opinion Research Center and made available through the Inter-university Consortium for Political and Social Research (ICPSR) at the University of Michigan.

 

nes. This dataset includes selected variables from the 2012 National Election Study, a random sample of 5,916 citizens of voting age, conducted by the University of Michigan’s Institute for Social Research and made available through ICPSR.

 

states. This dataset includes variables on each of the 50 states. Most of these variables were compiled by the authors from various sources.

 

 

ANALYSIS

The analysis will require you to run different kinds of functions in R Studio. All of these have been learned in DataCamp, reviewed in lecture, or practiced in tutorials. There are different functions for the same purpose. So long as you are answering the question, you are free to choose the function that you like best. You may install and use an additional R packages in order to access a favorite function. Just be sure to document this in R script so that you can reproduce the syntax in the Appendix.

 

When asked to produce a table or figure, do not use screenshots. Either export the image (e.g., box plot) from the R Plot (bottom right of R Studio), or in the case of tables, copy and paste from Excel or create and fill a table in Microsoft Word.

 

TEST QUESTIONS

[weights for total grade in brackets; out of 100%]

 

1.       [10%] Gay rights is a salient political issue here in Canada, as it is in the United States, Western Europe, and East Asia. But not everyone thinks similarly on the issue. Lets explore attitudes in the U.S. The nes dataset contains a variable gay_rights3, which measures attitudes toward gay rights by three categories: "Low" support, a middle position ("Mid"), and "High" support.

 

a.       What type of variable is gay_rights3?

 

b.      Report frequencies (a table or a bar chart is acceptable) for gay_rights3 and explain your findings in no more than 1 paragraph worth of text. Be sure your table or figure is appropriately labeled.

 

2.       [15%] Since gay_rights3 in the nes dataset is a measure of a policy position, let’s consider the relationship between this variable and political ideology. libcon3 shows respondents by political ideology (self-placement): liberal ("Lib"), moderate ("Mod"), and conservative ("Cons").

 

a.       If political ideology (libcon3) is the independent variable, what is your empirical expectation of the relationship? State your expectation as a hypothesis and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Run a two-way frequency table or a cross tabulation using gay_rights3 and libcon3. Use column percentages in your tables (you may report frequencies, too) and report the findings. Reproduce your output and interpret your findings in no more than 1 paragraph worth of text.

 

c.       Write a null hypothesis and run the appropriate bivariate test statistics to test the relationship between gay_rights3 and libcon3. Report the test statistic output and interpret the findings from this bivariate hypothesis test.

 

3.       [15%] Education is known to exercise a strong influence on policy positions. Let’s consider the possible effects that education has on the relationship between the variables gay_rights3 and libcon3, explored in questions 1 and 2 above. The nes variable dem_educ3 has three ordinal categories: high school or less ("HS or less"), some college ("Some coll"), or college degree or higher (“Coll+”). We will use this variable.

 

a.       If dem_educ3 is taken into account, what do you expect the effects on the relationship between gay_rights3 and libcon3? State your expectations and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Use dem_educ3 as a control variable, measuring the effects of higher education (“Coll+”) and lower education (“HS or less”) on the relationship between gay_rights3 and libcon3. Run a frequency table or cross tabulations for each condition and interpret your results in no more than 2 short paragraphs worth of text.[4] Use column percentages in your tables (you may report frequencies, too).

 

c.       Write null hypotheses for each table in 3b and run the appropriate bivariate test statistic to consider the relationship between gay_rights3 and libcon3. Report the test statistic output and interpret the findings from these bivariate hypothesis tests in no more than 2 paragraphs worth of text.

 

*****

 

4.       [15%] With the rise (or return) of populist-authoritarianism comes a renewed interest in political values, namely Authoritarianism (note: not the regime). This is a measure of how deferential one is to authority and authority figures (high authoritarianism = high deference). In the gss dataset authoritarianism measures this value: 0 (low authoritarianism) to 7 (high authoritarianism).[5] Let’s explore.

 

a.       Create a histogram or a bar chart. Paste it below and interpret your output in no more than 1 paragraph worth of text. Be sure your figure is appropriately labeled.

 

b.      Report and interpret the following descriptive statistics: (i) mean, (ii) median, (iii) standard error, and (iv) range.

 

c.       Report the confidence interval (at 95%) and interpret this statistic in less than 1 paragraph worth of text.

 

 

5.       [15%] It could be argued that those who undergo the experience of having and raising children change their attitudes on deference to authority and obeying others. Let’s consider the relationship between respondents with children and authoritarianism. In the gss dataset kids measures whether respondents have children (1 = “No”, 2 = “Yes”).

 

a.       If kids is the independent variable, what is your empirical expectation of the relationship? State your expectation as a hypothesis and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Create a box (and whisker) plot using kids and authoritarianism. Paste it below and interpret your output in no more than 1 paragraph worth of text.

 

c.       Write a null hypothesis and run the appropriate bivariate test statistics to consider the relationship between kids and authoritarianism. Report the test statistic output and interpret the findings from the bivariate hypothesis test.

 

 

*****

 

 

 

 

6.       [15%] Generally speaking, in the United States Republicans say and are understood as favoring less government intervention relative to Democrats – “less government” or “limited government” – so as to maximize individual freedom, that is freedom from government interference. Democrats tend to favor more government intervention. Let’s explore how well this claim holds up to the data using two of the most salient political issues in the U.S.: abortion and gun control.

The states dataset contains two variables of interest for our dependent variables: abort_rank3 and gun_rank3. Both show states’ views on abortion and gun control, specifically how much relative restriction the government should place on these two items: “more restr”, for more restriction (1); “mid” for moderate restriction (2); and “Less restr”, for less restriction (3). states contains another variable, cook_index3, which measures states’ partisan balance in three ascending codes, from Republican to Democrat (“More Rep”, “Even”, or “More Dem”). This is our independent variable.

 

 

a.       If cook_index3 is the independent variable, what are your empirical expectations? State these expectations in two hypotheses and explain your reasoning in no more than 2 paragraphs worth of text.

 

b.      Run cross tabulations for each of the two dependent variables, with states’ partisan balance (cook_index3) as the independent variable. Reproduce the findings below and interpret your results in no more than 2 paragraphs worth of text. Report column percentages (you may report frequencies, too).

 

c.       Based on our understanding of what Republicans and Democrats think about the role of government in society (described above), is there anything puzzling about the results? Consider in no more than 1 paragraph worth of text.

 

7.       [15%] States belonging to ‘the South’ – a geographic as well as sociological indicator – are generally understood as being more conservative. States contains a variable for the Southern states, south, with two categories (“Nonsouth” (1) and “South” (2)). Let’s consider how controlling for ‘the South’ does (or doesn’t) affect the nature of the relationship between partisan balance (cook_index3) and views on gun restriction (gun_rank3).

 

a.       If south is taken into account, what do you expect the effects to be? State your expectation and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Use south as a control variable, measure the effects of a state being in the South (“South”) and not in the South (“Nonsouth”) on the relationship between partisan balance (cook_index3) and views on gun control (gun_rank3). Run cross tabulations for each condition and interpret your results in no more than 2 short paragraphs worth of text. Report column percentages (you may report frequencies, too). (similar to 3b above)

 

c.       Write null hypotheses for each of your tables from 7b and run the appropriate bivariate test statistic to test the relationship between gay_rights3 and libcon3. Report the test statistic output and interpret the findings from this bivariate hypothesis test in no more than 2 paragraphs worth of text.

 

INTEGRITY STATEMENT

 

I, [type full name], hereby confirm that the Test #2 (take-home) for POL242 was completed independently and without assistance or guidance from others. I understand that failing to complete the assignment on my own will result in a mark of 0 and possible disciplinary action.

 

 

Date:

Student Number:

 



[1] Copy and paste your syntax from R Studio into Word. Otherwise, you can save your syntax just like you save a Word file (File > Save As) and then open the R file in a text editor or Microsoft Word.

[3] See reference manual for ‘poliscidata’ package at CRAN: https://cran.r-project.org/web/packages/poliscidata/poliscidata.pdf. Explanations for data taken from Pollock, Philip H., III. An R Companion to Political Analysis (p. 16). SAGE Publications. Kindle Edition.

[4] HINT for 3b: There is more than one way to take into account another variable, Z. You may want to subset the data or use frequency tables.

[5] Note that there are several missing variables (NAs). For some function (but not all, or not every time), this can cause problems. Be aware and know what to do in case you get funky output. (Hint: it often means telling R to ignore missing variables, usually by specifying na.rm=T.)

Assignment Description

2017-2018

POL 242Y5Y    Methods

 

Test #2

Due January 4 by 11am

 

 

 

OVERVIEW

The take-home examination is designed to test your understanding of research logic, R programming basics, data visualizing, tables and cross tabulations, and interpretation of bivariate hypothesis tests (with and without controls). You will need access to R Studio and an internet connection. The test is to be completed independently (no collaboration with peers).

 

INSTRUCTIONS

This test is not a collaborative exercise; it is to be completed independent of assistance or guidance form others. You should, however, use all of the resources that you have access to, especially those found online, if they are needed. Answer all questions in a separate Word document. Be sure to appropriately label your question numbers (1a., 1b., etc.). Include in your test document the Integrity statement, which confirms that the work is your own, independently done.

 

You are also required to submit your R syntax (the code) as an Appendix, so be sure to do all of your work in the R script, not in the Console.[1] Please label your R syntax by question number, too, so that it can be matched to the test question (use the # to add text to your script, or add it to the Appendix later).

 

When you are done, save the documents in one single file (Word or PDF are okay) and upload it to Blackboard at the appropriate location before class (11am) on January 4, 2018. No extensions will be granted except in cases of provable emergency, such as hospitalization of you or an immediate family (household) member.

 

Required parts of submission document:

i.                     Answers (includes tables and figures)

ii.                   R syntax (Appendix)

iii.                 Integrity statement

 

 

 

 

 

USING THE ‘POLISCI’ PACKAGE

You arent required to download any datasets for this assignment. Instead, you will use custom datasets from the poliscidata package.

 

First, you’ll need to install R Studio on your machine. (See the R Studio web site to download it for free[2]), if you haven’t already installed it. Then, download and install the poliscidata package:

 

install.packages("poliscidata")

 

Finally, load the package:

 

library(poliscidata)            

 

The poliscidata package has three datasets which you will use to complete the test. [3] Note: As these are prepackaged datasets, they will not load in the R “Environment” at the top right like data does when you load it from a web link or your computer. Don’t worry, the data are loaded and will appear if you call it. Datasets will appear in the Environment if you subset new dataset from the originals.

 

gss. This dataset has selected variables from the 2012 General Social Survey, a random sample of 1,974 adults aged 18 years or older, conducted by the National Opinion Research Center and made available through the Inter-university Consortium for Political and Social Research (ICPSR) at the University of Michigan.

 

nes. This dataset includes selected variables from the 2012 National Election Study, a random sample of 5,916 citizens of voting age, conducted by the University of Michigan’s Institute for Social Research and made available through ICPSR.

 

states. This dataset includes variables on each of the 50 states. Most of these variables were compiled by the authors from various sources.

 

 

ANALYSIS

The analysis will require you to run different kinds of functions in R Studio. All of these have been learned in DataCamp, reviewed in lecture, or practiced in tutorials. There are different functions for the same purpose. So long as you are answering the question, you are free to choose the function that you like best. You may install and use an additional R packages in order to access a favorite function. Just be sure to document this in R script so that you can reproduce the syntax in the Appendix.

 

When asked to produce a table or figure, do not use screenshots. Either export the image (e.g., box plot) from the R Plot (bottom right of R Studio), or in the case of tables, copy and paste from Excel or create and fill a table in Microsoft Word.

 

TEST QUESTIONS

[weights for total grade in brackets; out of 100%]

 

1.       [10%] Gay rights is a salient political issue here in Canada, as it is in the United States, Western Europe, and East Asia. But not everyone thinks similarly on the issue. Lets explore attitudes in the U.S. The nes dataset contains a variable gay_rights3, which measures attitudes toward gay rights by three categories: "Low" support, a middle position ("Mid"), and "High" support.

 

a.       What type of variable is gay_rights3?

 

b.      Report frequencies (a table or a bar chart is acceptable) for gay_rights3 and explain your findings in no more than 1 paragraph worth of text. Be sure your table or figure is appropriately labeled.

 

2.       [15%] Since gay_rights3 in the nes dataset is a measure of a policy position, let’s consider the relationship between this variable and political ideology. libcon3 shows respondents by political ideology (self-placement): liberal ("Lib"), moderate ("Mod"), and conservative ("Cons").

 

a.       If political ideology (libcon3) is the independent variable, what is your empirical expectation of the relationship? State your expectation as a hypothesis and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Run a two-way frequency table or a cross tabulation using gay_rights3 and libcon3. Use column percentages in your tables (you may report frequencies, too) and report the findings. Reproduce your output and interpret your findings in no more than 1 paragraph worth of text.

 

c.       Write a null hypothesis and run the appropriate bivariate test statistics to test the relationship between gay_rights3 and libcon3. Report the test statistic output and interpret the findings from this bivariate hypothesis test.

 

3.       [15%] Education is known to exercise a strong influence on policy positions. Let’s consider the possible effects that education has on the relationship between the variables gay_rights3 and libcon3, explored in questions 1 and 2 above. The nes variable dem_educ3 has three ordinal categories: high school or less ("HS or less"), some college ("Some coll"), or college degree or higher (“Coll+”). We will use this variable.

 

a.       If dem_educ3 is taken into account, what do you expect the effects on the relationship between gay_rights3 and libcon3? State your expectations and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Use dem_educ3 as a control variable, measuring the effects of higher education (“Coll+”) and lower education (“HS or less”) on the relationship between gay_rights3 and libcon3. Run a frequency table or cross tabulations for each condition and interpret your results in no more than 2 short paragraphs worth of text.[4] Use column percentages in your tables (you may report frequencies, too).

 

c.       Write null hypotheses for each table in 3b and run the appropriate bivariate test statistic to consider the relationship between gay_rights3 and libcon3. Report the test statistic output and interpret the findings from these bivariate hypothesis tests in no more than 2 paragraphs worth of text.

 

*****

 

4.       [15%] With the rise (or return) of populist-authoritarianism comes a renewed interest in political values, namely Authoritarianism (note: not the regime). This is a measure of how deferential one is to authority and authority figures (high authoritarianism = high deference). In the gss dataset authoritarianism measures this value: 0 (low authoritarianism) to 7 (high authoritarianism).[5] Let’s explore.

 

a.       Create a histogram or a bar chart. Paste it below and interpret your output in no more than 1 paragraph worth of text. Be sure your figure is appropriately labeled.

 

b.      Report and interpret the following descriptive statistics: (i) mean, (ii) median, (iii) standard error, and (iv) range.

 

c.       Report the confidence interval (at 95%) and interpret this statistic in less than 1 paragraph worth of text.

 

 

5.       [15%] It could be argued that those who undergo the experience of having and raising children change their attitudes on deference to authority and obeying others. Let’s consider the relationship between respondents with children and authoritarianism. In the gss dataset kids measures whether respondents have children (1 = “No”, 2 = “Yes”).

 

a.       If kids is the independent variable, what is your empirical expectation of the relationship? State your expectation as a hypothesis and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Create a box (and whisker) plot using kids and authoritarianism. Paste it below and interpret your output in no more than 1 paragraph worth of text.

 

c.       Write a null hypothesis and run the appropriate bivariate test statistics to consider the relationship between kids and authoritarianism. Report the test statistic output and interpret the findings from the bivariate hypothesis test.

 

 

*****

 

 

 

 

6.       [15%] Generally speaking, in the United States Republicans say and are understood as favoring less government intervention relative to Democrats – “less government” or “limited government” – so as to maximize individual freedom, that is freedom from government interference. Democrats tend to favor more government intervention. Let’s explore how well this claim holds up to the data using two of the most salient political issues in the U.S.: abortion and gun control.

The states dataset contains two variables of interest for our dependent variables: abort_rank3 and gun_rank3. Both show states’ views on abortion and gun control, specifically how much relative restriction the government should place on these two items: “more restr”, for more restriction (1); “mid” for moderate restriction (2); and “Less restr”, for less restriction (3). states contains another variable, cook_index3, which measures states’ partisan balance in three ascending codes, from Republican to Democrat (“More Rep”, “Even”, or “More Dem”). This is our independent variable.

 

 

a.       If cook_index3 is the independent variable, what are your empirical expectations? State these expectations in two hypotheses and explain your reasoning in no more than 2 paragraphs worth of text.

 

b.      Run cross tabulations for each of the two dependent variables, with states’ partisan balance (cook_index3) as the independent variable. Reproduce the findings below and interpret your results in no more than 2 paragraphs worth of text. Report column percentages (you may report frequencies, too).

 

c.       Based on our understanding of what Republicans and Democrats think about the role of government in society (described above), is there anything puzzling about the results? Consider in no more than 1 paragraph worth of text.

 

7.       [15%] States belonging to ‘the South’ – a geographic as well as sociological indicator – are generally understood as being more conservative. States contains a variable for the Southern states, south, with two categories (“Nonsouth” (1) and “South” (2)). Let’s consider how controlling for ‘the South’ does (or doesn’t) affect the nature of the relationship between partisan balance (cook_index3) and views on gun restriction (gun_rank3).

 

a.       If south is taken into account, what do you expect the effects to be? State your expectation and explain your reasoning in no more than 1 paragraph worth of text.

 

b.      Use south as a control variable, measure the effects of a state being in the South (“South”) and not in the South (“Nonsouth”) on the relationship between partisan balance (cook_index3) and views on gun control (gun_rank3). Run cross tabulations for each condition and interpret your results in no more than 2 short paragraphs worth of text. Report column percentages (you may report frequencies, too). (similar to 3b above)

 

c.       Write null hypotheses for each of your tables from 7b and run the appropriate bivariate test statistic to test the relationship between gay_rights3 and libcon3. Report the test statistic output and interpret the findings from this bivariate hypothesis test in no more than 2 paragraphs worth of text.

 

INTEGRITY STATEMENT

 

I, [type full name], hereby confirm that the Test #2 (take-home) for POL242 was completed independently and without assistance or guidance from others. I understand that failing to complete the assignment on my own will result in a mark of 0 and possible disciplinary action.

 

 

Date:

Student Number:

 



[1] Copy and paste your syntax from R Studio into Word. Otherwise, you can save your syntax just like you save a Word file (File > Save As) and then open the R file in a text editor or Microsoft Word.

[3] See reference manual for ‘poliscidata’ package at CRAN: https://cran.r-project.org/web/packages/poliscidata/poliscidata.pdf. Explanations for data taken from Pollock, Philip H., III. An R Companion to Political Analysis (p. 16). SAGE Publications. Kindle Edition.

[4] HINT for 3b: There is more than one way to take into account another variable, Z. You may want to subset the data or use frequency tables.

[5] Note that there are several missing variables (NAs). For some function (but not all, or not every time), this can cause problems. Be aware and know what to do in case you get funky output. (Hint: it often means telling R to ignore missing variables, usually by specifying na.rm=T.)

Customer Feedback

"Thanks for explanations after the assignment was already completed... Emily is such a nice tutor! "

Order #13073

Find Us On

soc fb soc insta


Paypal supported