{"id":165,"date":"2020-02-11T15:04:18","date_gmt":"2020-02-11T20:04:18","guid":{"rendered":"http:\/\/blogs.ubalt.edu\/jboettinger\/?p=165"},"modified":"2020-02-11T15:06:58","modified_gmt":"2020-02-11T20:06:58","slug":"using-spss-simple-linear-regression","status":"publish","type":"post","link":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/2020\/02\/11\/using-spss-simple-linear-regression\/","title":{"rendered":"Using SPSS: Simple Linear Regression"},"content":{"rendered":"<p>A regression can be seen as a kind of extension of a correlation. When doing a regression, you find a lot of the same outputs, like Pearson&#8217;s r and r-squared. The difference is that the point of a regression is to also construct a model (usually linear) that will help us predict values using a line of best fit. In the case of this example, we will be looking at average hours of sleep students get and comparing it to their GPA. A regression will also give us a model (y=mx+b) that would allow us to predict the GPA of a hypothetical student if we knew the average amount of sleep they get a night.<\/p>\n<p>First, we need to create our variables in Variable View.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-559\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression1-300x31.png\" alt=\"\" width=\"904\" height=\"94\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression1-300x31.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression1-768x79.png 768w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression1-1024x105.png 1024w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression1-624x64.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression1.png 1044w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/p>\n<p>Then, we need to input our data into Data View. You can&#8217;t see it in this photo, but I have 25 participants total.<!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-560\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression2-203x300.png\" alt=\"\" width=\"336\" height=\"496\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression2-203x300.png 203w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression2.png 274w\" sizes=\"(max-width: 336px) 100vw, 336px\" \/><\/p>\n<p>To start our regression, we need to go to Analyze &gt; Regression &gt; Linear.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-561\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression3-300x219.png\" alt=\"\" width=\"545\" height=\"398\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression3-300x219.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression3-624x455.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression3.png 739w\" sizes=\"(max-width: 545px) 100vw, 545px\" \/><\/p>\n<p>Once we click that, this pop-up will appear. Make sure to make your <em>predictor <\/em>the independent variable and the <em>predicted<\/em> variable the dependent variable.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-562\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression4-300x260.png\" alt=\"\" width=\"497\" height=\"431\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression4-300x260.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression4.png 563w\" sizes=\"(max-width: 497px) 100vw, 497px\" \/><\/p>\n<p>It may be important for you to then click the Statistics button and make sure to check what you need to include in your report. Descriptives and Confidence Intervals never hurt.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-563\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression5-300x254.png\" alt=\"\" width=\"549\" height=\"465\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression5-300x254.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression5.png 550w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><\/p>\n<p>Your output will look something like the following two pictures. Descriptives are at the top, so this will help you report your means and standard deviations if you need to. Next are your correlation matrices. In my case, it looks like Sleep and GPA have a somewhat strong positive correlation and it appears to be significant with a p- value of less than .001. Ignoring the variables entered\/removed section, the model summary shows us once again our r value and it also gives us an r-squared value. The ANOVA table gives us an F value and significance if we choose to report that. Finally (and the part we&#8217;ve been waiting for) is the model. This part is like in Algebra when you needed to learn about linear functions. We&#8217;re constructing a line using y=mx+b where the m is the slope and the b is the y-intercept. For this example, the model we&#8217;re working with is y=0.11x+.418 and I found these numbers from the coefficients table.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-564\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression6-205x300.png\" alt=\"\" width=\"369\" height=\"540\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression6-205x300.png 205w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression6.png 371w\" sizes=\"(max-width: 369px) 100vw, 369px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-565\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression7-300x210.png\" alt=\"\" width=\"755\" height=\"529\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression7-300x210.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression7-624x436.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression7.png 758w\" sizes=\"(max-width: 755px) 100vw, 755px\" \/><\/p>\n<p>Now let&#8217;s say you need a graph of this. Go to Graphs &gt; Legacy Dialogues &gt; Scatter Plot&#8230;<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-566\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression8-300x227.png\" alt=\"\" width=\"537\" height=\"406\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression8-300x227.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression8-624x473.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression8.png 680w\" sizes=\"(max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>This pop-up should appear. Just click Simple Scatter.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-567\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression9-300x192.png\" alt=\"\" width=\"553\" height=\"354\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression9-300x192.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression9.png 385w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/p>\n<p>Another pop-up should appear. Make sure your <em>predictor<\/em> is on the x-axis and the <em>predicted<\/em> variable is in the y-axis.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-568\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression10-275x300.png\" alt=\"\" width=\"517\" height=\"564\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression10-275x300.png 275w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression10.png 530w\" sizes=\"(max-width: 517px) 100vw, 517px\" \/><\/p>\n<p>You should end up with this basic scatterplot of your points.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-569\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression11-300x185.png\" alt=\"\" width=\"555\" height=\"342\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression11-300x185.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression11-768x473.png 768w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression11-624x384.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression11.png 898w\" sizes=\"(max-width: 555px) 100vw, 555px\" \/><\/p>\n<p>To get the line of best fit, right-click the graph &gt; Edit Content &gt; In Separate Window.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-570\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression12-300x196.png\" alt=\"\" width=\"574\" height=\"375\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression12-300x196.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression12-768x503.png 768w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression12-624x408.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression12.png 891w\" sizes=\"(max-width: 574px) 100vw, 574px\" \/><\/p>\n<p>A new editing pop-up will appear. Click the linear equation button at the bottom of the bar. It will say Add Fit Line at Total when you hover over it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-571\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression13-300x212.png\" alt=\"\" width=\"600\" height=\"424\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression13-300x212.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression13-768x542.png 768w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression13-624x440.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression13.png 863w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Once that&#8217;s done, your graph should look something like this. If you exit out of the pop-up to go back to the output, the output graph should represent the changes you made in the editor pop-up.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-572\" src=\"http:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression14-300x134.png\" alt=\"\" width=\"627\" height=\"280\" srcset=\"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression14-300x134.png 300w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression14-768x343.png 768w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression14-1024x457.png 1024w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression14-624x279.png 624w, https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-content\/uploads\/sites\/1114\/2019\/06\/linear-regression14.png 1364w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A regression can be seen as a kind of extension of a correlation. When doing a regression, you find a lot of the same outputs, like Pearson&#8217;s r and r-squared. The difference is that the point of a regression is to also construct a model (usually linear) that will help us predict values using a [&hellip;]<\/p>\n","protected":false},"author":1347,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[151,150,147],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/posts\/165"}],"collection":[{"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/users\/1347"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":3,"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":574,"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/posts\/165\/revisions\/574"}],"wp:attachment":[{"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ubalt.edu\/mathsupportcenter\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}