{"id":1865,"date":"2016-05-27T16:18:55","date_gmt":"2016-05-27T23:18:55","guid":{"rendered":"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/?p=1865"},"modified":"2016-05-27T16:20:56","modified_gmt":"2016-05-27T23:20:56","slug":"spatially-weighted-regression-case-study","status":"publish","type":"post","link":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/2016\/05\/27\/spatially-weighted-regression-case-study\/","title":{"rendered":"Spatially weighted regression: A case study"},"content":{"rendered":"<p><strong>Relationships\u00a0that vary in space and time: A challenge for simple linear regression<\/strong><\/p>\n<p>Regression is a fundamental analytical tool for any researcher interested in relating cause and effect.\u00a0A basic assumption of regression is that of stationarity, the principal that the relationship between a predictor variable and its response is constant across its sample space; that a relationship is true in all regions where it is being applied. This assumption is a particularly poor assumption in spatially based analyses, where we know\u00a0that interactions may exist between\u00a0known and often unknown factors\u00a0in how response variable relates to\u00a0a given\u00a0explanatory variable. While this is a \u00a0challenge to simple linear regression, it is also what generally makes spatial problems interesting: the fact that relationships are not constant across space and time.<\/p>\n<p>Spatially weighted regression challenges the assumption of stationary in that where simple linear regression develops a single relationship to describes\u00a0a phenomena, spatially weighted regression allows the relationship to vary spatially. Unhinging the relationship between a\u00a0explanatory variable and its response spatially creates a set of local\u00a0coefficient for\u00a0each instance where an explanatory variable is offered. This is done through the use of a \u00a0weighting function. Wherein simple linear regression, each data point assumes equal weight with regards to the final relationship, a weighting function applies greater import to values closer to where a regression point would be calculated.<\/p>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1867 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/Spatial-weighting-function-1-300x168.jpg\" alt=\"Spatial weighting function (1)\" width=\"513\" height=\"287\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/Spatial-weighting-function-1-300x168.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/Spatial-weighting-function-1-768x431.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/Spatial-weighting-function-1.jpg 798w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\n<p><em>Fig 1: A spatial weighting function\u00a0weights data points closer to a \u00a0regression point. In this way bandwidths can vary across a feature space, such that two local regression values may be constructed of\u00a0a\u00a0different number of data points.<\/em><\/p>\n<hr \/>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/SWR_drawing.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1868 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/SWR_drawing-300x158.jpg\" alt=\"SWR_drawing\" width=\"522\" height=\"275\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/SWR_drawing-300x158.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/SWR_drawing.jpg 628w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><\/p>\n<p><em>Fig 2: Spatially weighted regression allows the relationship between a response and explanatory to vary across a study region.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>NDVI and weed density: A case study in spatially weighted regression<\/strong><\/p>\n<p>Normalized difference vegetation index (NDVI)\u00a0has been used in remote sensing \u00a0as a proxy for phenology in many remote sensing and cropping systems studies. NDVI is calculated as the ratio of red to near-infrared light, and is generally related to the amount of green photo-synthetically active tissue.\u00a0In principal, weeds and crops should be distinguishable based on how their NDVI response varies in time.<\/p>\n<hr \/>\n<p><strong>Question: Can NDVI be used to predict weed density? Does the relationship between NDVI and weed density vary spatially?\u00a0<\/strong><\/p>\n<hr \/>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/NDVI_swr.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1871 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/NDVI_swr-300x160.jpg\" alt=\"NDVI_swr\" width=\"473\" height=\"252\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_swr-300x160.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_swr-768x409.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_swr.jpg 946w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><\/a><\/p>\n<p><em>Fig 3:\u00a0A general hypothesis for how weeds and crop may\u00a0in their NDVI response. Weeds may mature earlier or later than a crop, but this relationship may also vary spatially.<\/em><\/p>\n<p>Here, spatially weighted regression is offered as a method for distinguishing relationships between weed density and NDVI. Allowing the relationship between NDVI and weed density to vary spatially may allow one classify areas of the field based on\u00a0the nature of these relationships.<\/p>\n<hr \/>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/NDVI_gif.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1873 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/NDVI_gif-300x300.gif\" alt=\"NDVI_gif\" width=\"300\" height=\"300\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_gif-300x300.gif 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_gif-150x150.gif 150w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_gif-768x768.gif 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><em>Fig 4:\u00a0NDVI over the course of the growing season at a 17 acre field located NE of Pendleton, OR, Summer 2015. Note that the field does not increase or decrease in NDVI evenly, but rather peak\u00a0NDVI passes as a wave across the field. [ Note: GIF does not appear animated in preview. Click on the GIF directly if animation is not working ]<\/em><\/p>\n<p>An important first step in deciding if a data set is suitable for spatially weighted regression is to look at\u00a0the residuals of the linear relationship you are choosing to model. Here we\u00a0examine the following function for predicting weed density:<\/p>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/NDVI_form-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1882 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/NDVI_form-1-300x72.jpg\" alt=\"NDVI_form (1)\" width=\"300\" height=\"72\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_form-1-300x72.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/NDVI_form-1.jpg 411w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This function uses 3 samples of NDVI over the course of the growing season, centered around the time of peak NDVI. The purpose of using these 3 times was to try and emphasize time periods where weeds and crop would vary in their relative response in NDVI.<\/p>\n<hr \/>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_obs.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1884 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_obs-300x300.jpg\" alt=\"PlantHS_obs\" width=\"300\" height=\"300\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_obs-300x300.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_obs-150x150.jpg 150w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_obs-768x768.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_obs-1024x1024.jpg 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_obs.jpg 1500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><em>Fig 5:\u00a0Weed densities were calculated based on linear transects made prior to harvest. Weed hot spots were calculated using the\u00a0Getis-Ord Gi* statistic in ArcMap. Weed hot spots from a prior\u00a0analysis were used as input for predicting weed density in this exercise.<\/em><\/p>\n<hr \/>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_glm_pred.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1885 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_glm_pred-300x300.jpg\" alt=\"PlantHS_glm_pred\" width=\"300\" height=\"300\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_pred-300x300.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_pred-150x150.jpg 150w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_pred-768x768.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_pred-1024x1024.jpg 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_pred.jpg 1500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><em>Fig 6:\u00a0Predicted weed density for a\u00a0multiple\u00a0regression model based on 3\u00a0measurements of NDVI surrounding peak NDVI. \u00a0<\/em>Multiple R2:\u00a0 0.044, P-value &lt; 0.001<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_glm_resid.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1886 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_glm_resid-300x300.jpg\" alt=\"PlantHS_glm_resid\" width=\"300\" height=\"300\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_resid-300x300.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_resid-150x150.jpg 150w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_resid-768x768.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_resid-1024x1024.jpg 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_glm_resid.jpg 1500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><em>Fig 7: Residuals from\u00a0a\u00a0multiple\u00a0regression model based on 3\u00a0measurements of NDVI surrounding peak NDVI. \u00a0Both high and low residuals cluster spatially, indicating that the relationship between NDVI and weed density may vary spatially and may be a good candidate for geographically weighted regression.<\/em><\/p>\n<hr \/>\n<p><a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_swr_pred.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1888 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/PlantHS_swr_pred-300x300.jpg\" alt=\"PlantHS_swr_pred\" width=\"300\" height=\"300\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_swr_pred-300x300.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_swr_pred-150x150.jpg 150w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_swr_pred-768x768.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_swr_pred-1024x1024.jpg 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/PlantHS_swr_pred.jpg 1500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><em>Fig\u00a08:\u00a0Predicted weed density from a spatially weighted regression.\u00a0Quasi-global R2: 0.92.<\/em><\/p>\n<p>By using a spatially weighted regression, we&#8217;re able to account for 92 percent of the variance that occurs in the distribution of weeds in this field. Unlike in a standard regression, the result of this process is a collection of local regression formula.\u00a0In this sense, the result is not a result that can be easily extrapolated to predict weeds distributions in future data sets. However, these coefficients do offer us the opportunity to look for\u00a0some\u00a0spatial patterns that may yield additional information as to what the nature of these local spatial relationships might be<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p><em><br \/>\n<a href=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/Slope_coef-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1901 aligncenter\" src=\"http:\/\/blogs.oregonstate.edu\/geo599spatialstatistics\/files\/2016\/05\/Slope_coef-1-300x300.jpg\" alt=\"Slope_coef\" width=\"490\" height=\"490\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/Slope_coef-1-300x300.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/Slope_coef-1-150x150.jpg 150w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/Slope_coef-1-768x768.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/1572\/files\/2016\/05\/Slope_coef-1-1024x1024.jpg 1024w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/a><\/em><\/p>\n<p><em>Fig 10:\u00a0\u00a0Map classified by\u00a0coefficient slope.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Relationships\u00a0that vary in space and time: A challenge for simple linear regression Regression is a fundamental analytical tool for any researcher interested in relating cause and effect.\u00a0A basic assumption of regression is that of stationarity, the principal that the relationship between a predictor variable and its response is constant across its sample space; that a&hellip; <a href=\"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/2016\/05\/27\/spatially-weighted-regression-case-study\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":7719,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1865","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/posts\/1865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/users\/7719"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/comments?post=1865"}],"version-history":[{"count":13,"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/posts\/1865\/revisions"}],"predecessor-version":[{"id":1904,"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/posts\/1865\/revisions\/1904"}],"wp:attachment":[{"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/media?parent=1865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/categories?post=1865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.blogs.oregonstate.edu\/geo599spatialstatistics\/wp-json\/wp\/v2\/tags?post=1865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}