Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

OLS Regression in R Project Worksheet

OLS Regression in R Project Worksheet

OLS Regression in R Project Worksheet

Description

Unformatted Attachment Preview

face
year state winner
loser
w.party l.party d.votes r.votes
d.comp
r.comp
### CA
Feinstein
Campbell
D
R
6E+06
4E+06
56.45676
43.54324
### DE
Carper
Roth
D
R
181387 142683
34.19122
65.80878
### FL
Nelson
McCollum
D
R
3E+06
3E+06
61.2368
38.7632
### GA
Miller
Mattingly
D
R
1E+06 933698
54.15328
45.84672
### HI
Akaka
Carroll
D
R
251130
84657
68.02323
31.97677
### IN
Lugar
Johnson
R
D
684242
1E+06
32.05024
67.94976
### MA
Kennedy
Robinson
D
R
2E+06 334721
40.37564
59.62436
### MD
Sarbanes Rappaport D
R
1E+06 678376
60.30148
39.69852
### ME
Snowe
Lawrence
R
D
197742 431727
53.85731
46.14269
### MI
Stabenow Abraham
D
R
2E+06
2E+06
86.92155
13.07845
### MN
Dayton
Grams
D
R
1E+06
1E+06
56.53347
43.46653
### MO
Lott
Brown
R
D
296149 621500
59.47913
40.52087
### MT
Burns
Schweitzer R
D
194567 208026
24.83992
75.16008
### ND
Conrad
Sand
D
R
177661 111376
64.96691
35.03309
### NE
Nelson
Stenberg
D
R
330366 318368
24.50116
75.49884
### NM
Bingaman Redmond
D
R
363279 225040
75.43906
24.56094
### NV
Ensign
Bernstein
R
D
238243 330663
39.04
60.96001
### OH
DeWine
Celeste
R
D
2E+06
3E+06
32.55931
67.44069
### PA
Santorum Klink
R
D
2E+06
2E+06
57.89419
42.10581
### RI
Chafee
Weygand
R
D
165367 226592
43.70468
56.29533
### TN
Frist
Clark
R
D
617684
1E+06
11.45066
88.54934
### TX
Hutchison Kelly
R
D
2E+06
4E+06
20.46027
79.53973
### UT
Hatch
Howell
R
D
241129 501925
44.24649
55.75351
### VA
Allen
Robb
R
D
1E+06
1E+06
74.16958
25.83042
### VT
Jeffords
Flanagan
R
D
72909 188070
45.78164
54.21836
### WA
Cantwell
Gorton
D
R
1E+06
1E+06
61.45146
38.54854
### WI
Kohl
Gillespie
D
R
2E+06 941132
61.43566
38.56434
### WV
Byrd
Gallaher
D
R
462566 119958
68.36566
31.63434
### WY
Thomas
Logan
R
D
47039 157316
22.40634
77.59366
### AK
Stevens
Vondersaar R
D
20466 155054
33.35918
66.64082
### AL
Sessions
Parker
R
D
537882 790757
55.1095
44.8905
### AR
Pryor
Hutchinson D
R
435346 372909
27.38834
72.61166
### CO
Allard
Strickland
R
D
634227 707349
40.15365
59.84635
### DE
Biden
Clatworthy D
R
135170
94716
63.95782
36.04218
### GA
Chambliss Cleland
R
D
928905
1E+06
24.61636
75.38364
### IA
Harkin
Ganske
D
R
550156 446209
71.0124
28.9876
### ID
Craig
Blinken
R
D
132845 265849
45.75244
54.24756
### IL
Durbin
Durkin
D
R
2E+06
1E+06
42.80349
57.19651
### KY
McConnell Weinberg
R
D
400818 726396
56.27351
43.72649
### LA
Landrieu
Terrell
D
R
563400 327975
76.69162
23.30838
### ME
Collins
Pingree
R
D
205901 290266
32.72677
67.27323
### MI
Levin
Raczkowski D
R
2E+06
1E+06
70.3998
29.6002
### MN
Coleman
Mondale
R
D
1E+06
1E+06
66.58459
33.41541
### MO
Talent
Carnahan
R
D
911507 934093
39.67437
60.32563
### MT
Baucus
Taylor
D
R
202908 102766
89.72281
10.27719
### NC
Dole
Bowles
R
D
1E+06
1E+06
31.32851
68.67149
### NE
Hagel
Matulka
R
D
68657 391648
21.38063
78.61937
### NH
Sununu
Shaheen
R
D
206689 225506
52.61141
47.38859
### NJ
Lautenber Forrester
D
R
1E+06 909383
63.62293
36.37707
### NM
Domenici Tristani
R
D
161409 296935
34.61136
65.38864
### OK
Inhofe
Walters
R
D
369789 578579
44.9049
55.0951
### OR
Smith
Bradbury
R
D
487995 695345
40.22316
59.77684
### RI
Reed
Tingle
D
R
241315
66613
71.16785
28.83215
### SC
Graham
Sanders
R
D
484798 597789
57.3504
42.6496
### SD
Johnson
Thune
D
R
167481 166954
31.82353
68.17647
### TN
Alexander Clement
R
D
726510 888223
52.23733
47.76267
### TX
Cornyn
R
D
2E+06
2E+06
43.03733
56.96267
### WV
Rockefell Wolfe
D
R
271314 158211
63.87021
36.12979
### WY
Enzi
Corcoran
R
D
49587 133615
17.58161
82.41839
### AL
Shelby
Sowell
R
D
593302
1E+06
32.23141
67.7686
### AK
Murkowski Knowles
R
D
110699 121027
41.93548
58.06452
### AR
Lincoln
Holt
D
R
573793 454132
73.6
26.4
### CA
Boxer
Jones
D
R
6E+06
4E+06
59.83607
40.16393
### CO
Salazar
Coors
D
R
1E+06 944520
51.2605
48.7395
### CT
Dodd
Orchulli
D
R
923836 452874
61.86441
38.13559
### FL
Martinez
Castor
R
D
4E+06
4E+06
44.16667
55.83333
### GA
Isakson
Majette
R
D
1E+06
2E+06
61.78862
38.21138
### HI
Inouye
Cavasso
D
R
313269
87119
73.17073
26.82927
### IL
Obama
Keyes
D
R
4E+06
1E+06
16.48352
83.51648
### IN
Bayh
Scott
D
R
1E+06 902108
55
45
### IA
Grassley
Small
R
D
403434
1E+06
51.69492
48.30508
### KY
Brownback Jones
R
D
307968 777198
35.71429
64.28571
### KZ
Bunning
Mongiardo R
D
850756 873596
69.67213
30.32787
### LA
Vitter
JohnKenne R
D
275494 942755
35.2
64.8
### MD
Mikulski
Pipkin
D
R
1E+06 725898
50.86207
49.13793
### MS
Bond
Farmer
R
D
1E+06
2E+06
62.18487
37.81513
### NC
Burr
Bowles
R
D
2E+06
2E+06
27
73
### ND
Dorgan
Liffrig
D
R
211503
98244
75.86207
24.13793
### NV
Reid
Zizer
D
R
490232 282255
74.79675
25.20325
### NH
Gregg
Haddock
R
D
221011 434292
6.4
93.6
### NY
Schumer
Mills
D
R
4E+06
2E+06
31.81818
68.18182
### OH
Voinovich Fingerhut
R
D
2E+06
3E+06
58.19672
41.80328
### OK
Coburn
Carson
R
D
596672 763332
29.26829
70.73171
### OR
Wyden
King
D
R
1E+06 536506
60
40
### PA
Spekter
Hoeffel
R
D
2E+06
3E+06
71.2
28.8
### SC
Demint
Tenenbaum R
D
691918 843884
46.4
53.6
### SD
Thune
Daschle
R
D
193279 197814
36.79245
63.20755
### UT
Bennett
VanDam
R
D
237415 564260
76.19048
23.80952
### VT
Leahy
McMullen
D
R
212850
74704
66.07143
33.92857
### WA
Murray
Nethercutt D
R
1E+06 935992
26.44628
73.55372
### WI
Feingold
Michels
D
R
2E+06
1E+06
54.91803
45.08197
### AZ
Kyl,Jon
Pederson,
R
D
505136 605266
20.63492
79.36508
### CA
Feinstein
Mountjoy,
D
R
4E+06
2E+06
71.92982
28.07018
### DE
Carper,T
Ting,Jan
D
R
170544
69732
83.87097
16.12903
### FL
Nelson,B
Harris,Ka
D
R
3E+06
2E+06
54.83871
45.16129
### ME
Snowe,Ol Bright,Je
R
D
108796 393230
44.2623
55.7377
### MD
Cardin,B
D
R
846709 682641
27.86885
72.13115
### MA
Kennedy, Chase,Ken D
R
1E+06 658374
67.34694
32.65306
### MI
Stabenow, Vouchard,
D
R
2E+06
2E+06
52.38095
47.61905
### MN
Klobuchar Kennedy,M D
R
1E+06 839173
29.03226
70.96774
### MS
Lott,Tre
Fleming,E
R
D
205518 375307
43.63636
56.36364
### MO
McCaskill Talent,Ji
D
R
1E+06 987077
52.54237
47.45763
### MT
Tester,J
Burns,Con D
R
198302 195455
16.39344
83.60656
### NE
Nelson,B
Ricketts,
D
R
371777 211111
61.29032
38.70968
### NV
Ensign,J
Carter,Ja
R
D
237875 321186
17.46032
82.53968
### NJ
Menendez, Kean,Tom D
R
1E+06 973895
68.33333
31.66667
### NM
Bingaman, McCulloch, D
R
371068 156314
61.66667
38.33333
### ND
Conrad,K Grotberg,
D
R
149317
64133
53.96825
46.03175
### OH
Brown,Sh DeWine,Mi D
R
2E+06
2E+06
59.01639
40.98361
### PA
Casey,Bo Santorum,
D
R
2E+06
2E+06
8.474576
91.52542
### RI
Whitehous Chafee,Li
D
R
205274 178548
78.68852
21.31148
### TN
Corker,B
R
D
877716 927343
26.41509
73.58491
### TX
Hutchison Radnofsky, R
D
2E+06
3E+06
41.66667
58.33333
### UT
Hatch,Or
D
168551 342901
8.928571
91.07143
### VA
Webb,Jam Allen,Geo
D
R
1E+06
1E+06
11.47541
88.52459
### WA
Cantwell,
McGavick, D
R
652515 445395
39.68254
60.31746
### WV
Byrd,Rob JohnRaese D
R
291058 152315
32.78689
67.21311
### WI
Kohl,Her
R
1E+06 628879
57.37705
42.62295
### WY
Thomas,C Groutage,
D
57640 134942
25
75
Kirk
Steele,Mi
Ford,Haro
Ashdown,P R
Lorge,Rob D
R
1
### Facial Appearance and Election outcomes ###
Several psychologists have reported the intriguing result of an experiment showing that facial
appearance predicts election outcomes better than chance. In their experiment, the researchers
briefly showed student subjects the black-and-white headshots of two candidates from a US
congressional election (winner and runner-up). The exposure of subjects to facial pictures lasted
less than a second, and the subjects were then asked to evaluate the two candidates in terms of
their perceived competence. Using this data, let’s analyze the relationship between facial
appearance and election outcomes.
1. Load a dataset face.csv
2. You are going to make three new variables in the data frame.
? First, add a column called “d.share” which is the proportion of votes the Democratic
candidate received.
? It can be computed by
? Second, add a column called “r.share” which is the proportion of votes the Republican
candidate received.
? It can be computed by
.
? Last, add a column called “diff.share” which is the difference between d.share and r.share.
? diff.share = d.share – r.share
? This value specifically refers to the “Democratic margin in vote share.”
3. Let’s visualize the relationship between X and Y. We are interested if candidates’ facial
appearance (X) is associated with (predicts) their vote share (Y). You are making a scatter plot
with a linear fitted line. Please make a plot of X (d.comp) and Y (diff.share). Add the title “Facial
competence and vote share.” Also, change the label of the X-axis to “Competence scores for
Democrats” and the Y-axis to “Democratic margin in vote share.”
4. Let’s run a regression. Using lm(), regress diff.share (Y) on d.comp (X).
5. Interpret the result. What is the intercept, and how do you interpret this number? What is the
slope coefficient, and how do you interpret this number?
6. Imagine the competence score for Democrats is 60. What would we predict their margin in
vote share will be?
7. Imagine there is an increase in the competence score for Democrats by 20. What would we
predict that the margin in vote share would change?
8. Save the lm() result to “fit” and use the function “summary(fit)”. Based on the result, is facial
appearance significantly associated with vote share at the 5% significance level? please explain
the result by (1) comparing the t-statistic (t-value) with a critical value and (2) interpreting the
p-value.

Purchase answer to see full
attachment
Explanation & Answer:

3 pages

User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20