<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using Counts to Predict Counts in a Geospatial Setting in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/515253#M73235</link>
    <description>&lt;P&gt;Given a set of phone call coordinates within a city, I'm attempting to predict one type of phone call (mcall) with another type of phone call (tcall) while controlling for the daytime population (daypop) of the city. My data is on a census tract level (n=142 census tracts, to imitate neighborhoods). Eventually, once I figure out a proper model at the most simple level, I will incorporate population characteristics as&amp;nbsp;covariates to try and determine any significant characteristics&amp;nbsp; on the census tract (neighborhood) level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Structure Example:&lt;/P&gt;&lt;P&gt;TRACT&amp;nbsp; &amp;nbsp; &amp;nbsp;MCALL_COUNT&amp;nbsp; &amp;nbsp; &amp;nbsp;TCALL_COUNT&amp;nbsp; &amp;nbsp; &amp;nbsp;DAYPOP&lt;/P&gt;&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1,256&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 632&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6,681&lt;/P&gt;&lt;P&gt;02468&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;875&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 458&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4,200&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1: How do I properly utilize an offset if I need to have a rate for both types of phone calls? Would I feed in the tcall_count into the model as a rate instead and take the natural log&amp;nbsp;[i.e. ln(tcall_count/daypop)]?&lt;/P&gt;&lt;P&gt;Question 2: Is the random statement setup properly to assume all census tracts are considered in the covariance of the model?&lt;/P&gt;&lt;P&gt;Question 3: When I add in more covariates (i.e. population characteristics), I have had troubles with convergence, is this due to the model structure?&lt;/P&gt;&lt;P&gt;Question 4: Is there a better way to model the spatial autocorrelation of the centroids of the census tracts (i.e. lat_centered lon_centered)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the most simple version of what I've tried:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc glimmix data=analysis_n;&lt;BR /&gt;                ln_daypop = log(daypop);
		model mcall_count = tcall_count / dist=poisson offset=ln_daypop solution;
		random _residual_ / subject=intercept type=sp(exp)(lat_centered lon_centered);
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS Version 9.4 M5&lt;/P&gt;</description>
    <pubDate>Wed, 21 Nov 2018 22:13:41 GMT</pubDate>
    <dc:creator>rburnham</dc:creator>
    <dc:date>2018-11-21T22:13:41Z</dc:date>
    <item>
      <title>Using Counts to Predict Counts in a Geospatial Setting</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/515253#M73235</link>
      <description>&lt;P&gt;Given a set of phone call coordinates within a city, I'm attempting to predict one type of phone call (mcall) with another type of phone call (tcall) while controlling for the daytime population (daypop) of the city. My data is on a census tract level (n=142 census tracts, to imitate neighborhoods). Eventually, once I figure out a proper model at the most simple level, I will incorporate population characteristics as&amp;nbsp;covariates to try and determine any significant characteristics&amp;nbsp; on the census tract (neighborhood) level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Structure Example:&lt;/P&gt;&lt;P&gt;TRACT&amp;nbsp; &amp;nbsp; &amp;nbsp;MCALL_COUNT&amp;nbsp; &amp;nbsp; &amp;nbsp;TCALL_COUNT&amp;nbsp; &amp;nbsp; &amp;nbsp;DAYPOP&lt;/P&gt;&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1,256&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 632&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6,681&lt;/P&gt;&lt;P&gt;02468&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;875&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 458&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4,200&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1: How do I properly utilize an offset if I need to have a rate for both types of phone calls? Would I feed in the tcall_count into the model as a rate instead and take the natural log&amp;nbsp;[i.e. ln(tcall_count/daypop)]?&lt;/P&gt;&lt;P&gt;Question 2: Is the random statement setup properly to assume all census tracts are considered in the covariance of the model?&lt;/P&gt;&lt;P&gt;Question 3: When I add in more covariates (i.e. population characteristics), I have had troubles with convergence, is this due to the model structure?&lt;/P&gt;&lt;P&gt;Question 4: Is there a better way to model the spatial autocorrelation of the centroids of the census tracts (i.e. lat_centered lon_centered)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the most simple version of what I've tried:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc glimmix data=analysis_n;&lt;BR /&gt;                ln_daypop = log(daypop);
		model mcall_count = tcall_count / dist=poisson offset=ln_daypop solution;
		random _residual_ / subject=intercept type=sp(exp)(lat_centered lon_centered);
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS Version 9.4 M5&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 22:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/515253#M73235</guid>
      <dc:creator>rburnham</dc:creator>
      <dc:date>2018-11-21T22:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Counts to Predict Counts in a Geospatial Setting</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/515422#M73240</link>
      <description>&lt;P&gt;If you are mostly interested in prediction, and not in inference, you&amp;nbsp;might accept to&amp;nbsp;venture into statistically shaky territory...&amp;nbsp;How would&amp;nbsp; the model &lt;EM&gt;log(mcall/tcall) = a*log(daypop) + b&lt;/EM&gt;&amp;nbsp;fit with OLS, for example?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 19:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/515422#M73240</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-11-22T19:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using Counts to Predict Counts in a Geospatial Setting</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/516508#M73267</link>
      <description>&lt;P&gt;Thanks PG Stats. I took your suggestion of OLS and dropped the poisson part of the model since I have plenty high counts. Any concerns with having the model structured in this fashion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro poisson_model(covars);
	proc glimmix data=analysis_n plots=all;
		ln_daypop = log(est_daypop);&lt;BR /&gt;		lnmcall = log(mcall);&lt;BR /&gt;		lntcall = log(tcall);
		model lnmcall = lntcall ln_daypop &amp;amp;covars. / solution;
		random _residual_ / subject=intercept type=sp(exp)(lat_centered lon_centered);
	run;
%mend poisson_model;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The covars macro variable would eventually include population characteristics (using forward selection) such as median household income, % employed, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ln(tcall) is a significant predictor of ln(mcall), and now I'm simply trying to find significant population characteristics associated with the mcalls given I'm controlling for the tcalls.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 22:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/516508#M73267</guid>
      <dc:creator>rburnham</dc:creator>
      <dc:date>2018-11-27T22:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Counts to Predict Counts in a Geospatial Setting</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/516570#M73272</link>
      <description>&lt;P&gt;Sounds like a good strategy. Do not underestimate the value of data visualization, it can save you hours of aimless wandering.&amp;nbsp;Plot the residuals against your predicted values and&amp;nbsp;your other predictors. Forward selection might give you a starting point but the final model should be one that makes sense to you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 04:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/516570#M73272</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-11-28T04:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using Counts to Predict Counts in a Geospatial Setting</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/516794#M73282</link>
      <description>Thanks for your help! After residual diagnostic review, I'm happy with the model fit.</description>
      <pubDate>Wed, 28 Nov 2018 16:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Counts-to-Predict-Counts-in-a-Geospatial-Setting/m-p/516794#M73282</guid>
      <dc:creator>rburnham</dc:creator>
      <dc:date>2018-11-28T16:49:56Z</dc:date>
    </item>
  </channel>
</rss>

