Dfreligmoney nes08dfv085201e usena ifany 1 0 0 1 1563

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: =0 table(nes08.df$freemkt.vs.govt, nes08.df$V085106, useNA = &quot;ifany&quot;) ## Check the recode 1 0 1514 1 0 &lt;NA&gt; 0 2 &lt;NA&gt; 0 0 543 0 0 265 table(nes08.df$relig.money, nes08.df$V085201e, useNA = &quot;ifany&quot;) 1 0 0 1 1563 &lt;NA&gt; 0 ## Check the recode 5 &lt;NA&gt; 535 0 0 0 0 224 3. How do you expect your explanatory variable to relate to your outcome variable? Please sketch the scatterplot you expect to see and draw a line on this scatterplot to represent your expected relationship. Hint 1: Recall that the outcome deﬁnes the vertical axis and the explanatory the horizontal axis. Hint 2: The line does not have to be a straight line. In my case, I am guessing that free market ideology should not have any systematic relationship with donating money to religious groups: Hypothetical Relationship between No par(mfrow=c(1,1),pty=&quot;s&quot;,mar=c(3,3,3,0)) plot(c(0,1),c(.5,.5),xlim=c(0,1),ylim=c(0,1),axes=FALSE, xlab=&quot;Strong Gvt to Free Mkt&quot;, ylab=&quot;Money to Relig Org (No to Yes)&quot;, main=&quot;Hypothetical Relationship between \n Religious Donations and Economic Ideology&quot;, type=&quot;l&quot;,lwd=3) axis(1,at=c(0,1),labels=c(&quot;Gvt&quot;,&quot;Mkt&quot;)) axis(2,at=c(0,1),labels=c(&quot;No&quot;,&quot;Yes&quot;)) Money to Relig Org (No to Yes) Yes Religious Donations and Economic Ideology Gvt Mkt 4. What model design would allow you to assess your expectations? If you had to recode your variable, use the new name from now on. Hint: Recall that a model design is a statement about a relationship, like y ∼ x for a simple linear relationship or y ∼ x + x 2 + x 3 for a more curvy relationship or y ∼ x ∗ I ( x &gt; 20) for the situation where the relationship between y and x may change before versus after x = 20 or, another version of the same idea, y ∼ x ∗ g where g is a variable representing a particular group or type Class 12 — Political Science 230 An Interlude about Data and Final Reports— October 8, 2013— 2 of row (indicating diﬀerent eﬀects of x on y for diﬀerent values of g), etc . . . . Since these are both binary variables (also called dichotomous or ’two-valued’) only a linear relationship is sensible. My proposed model design is: relig.money ∼ 1 + freemkt.vs.govt 5. Fit this model design to the data using lm(). What coeﬃcients do you get? Interpret the coeﬃcients. Hint 1: If you have a non-linear term (like x 2 ) in your formula, you’ll need to use the I() function. For example, I might write: lm1&lt;-lm(y~x+I(x^2),data=mydata) @ which would include a quadratic term. \emph{Hint 2:} Make sure to save the results of your linear model fitting as I did here in \Verb+lm1+ for use in the next question. \emph{Hint 3:} If you decide on a nonlinear term like $x^2$, I recommend using the \Verb+predict()+ command rath...
View Full Document

Ask a homework question - tutors are online