Date: Tue, 22 Sep 2009 14:44:27 -0500 Joe Matise "SAS(r) Discussion" Joe Matise Re: Calculating averages within 1, 2, 3 miles from each point To: Imam Xierali text/plain; charset=ISO-8859-1

Good to know...

Anyhow, what version of SAS do you have? There are some potentially useful functions in v9.2 like GEODIST that may help you, if you have it.

-Joe

On Tue, Sep 22, 2009 at 2:38 PM, Imam Xierali <imamx8@gmail.com> wrote:

> Hi Carl, > > This is definitely not related to White House. It is related to the > health workforce and the points are simulated random points. Well, DC > is small but lots of health workers. > > Imam > > On Tue, Sep 22, 2009 at 2:35 PM, Carl Denney > <cdenney@healthinfotechnics.com> wrote: > > Can we be a bit cautious when requested to help someone compute distances > from the White House? > > > > > > > > > > > > > > -----Original Message----- > > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ya > Huang > > Sent: Tuesday, September 22, 2009 12:18 PM > > To: SAS-L@LISTSERV.UGA.EDU > > Subject: Re: Calculating averages within 1, 2, 3 miles from each point > > > > How do you define the distance between each id? > > I tried d=sqrt((x1-x2)**2 + (y1-y2)**2), all the pairs has distance << 1? > > > > On Tue, 22 Sep 2009 11:59:01 -0400, Imam Xierali <imamx8@GMAIL.COM> > wrote: > > > >>Hi programmers, > >> > >>Anyone has a code for calculating averages of k2 within 1, 2, 3 miles > >>from each point from the following dataset? So the output would be > >>three distances d1, d2, d3 that get the mean k2 of points within 1, 2, > >>3 miles for each record. > >> > >>Many thanks, > >> > >> > >> > >>data dck; > >>input Id x y k1 k2; > >>cards; > >>1 -77.073923 38.912835 3.951 2.183 > >>2 -77.005398 38.872825 3.229 11.472 > >>3 -76.925642 38.896538 3.628 3.015 > >>4 -77.000521 38.908816 3.508 4.346 > >>5 -77.01099 38.835734 3.671 8.485 > >>6 -77.036519 38.893915 3.301 1.476 > >>7 -76.987287 38.860589 3.163 8.15 > >>8 -76.986608 38.874276 3.856 4.213 > >>9 -76.954017 38.892108 3.236 6.544 > >>10 -77.065562 38.921784 3.598 1.571 > >>11 -77.045664 38.967122 3.342 4.662 > >>12 -76.938105 38.892845 3.481 9.245 > >>13 -77.099989 38.936615 3.796 1.247 > >>14 -76.989294 38.860997 3.466 34.195 > >>15 -76.978554 38.91056 3.398 5.112 > >>16 -77.004724 38.954793 3.383 5.502 > >>17 -77.038823 38.827295 3.819 2.568 > >>18 -77.004309 38.891357 3.486 0.719 > >>19 -77.022845 38.917487 3.29 3.326 > >>20 -76.991717 38.930888 3.691 3.368 > >>21 -77.002052 38.850847 3.413 13.903 > >>22 -77.031384 38.889208 3.431 1.026 > >>23 -77.032186 38.839916 3.619 9.474 > >>24 -76.983342 38.938643 3.715 3.681 > >>25 -77.017804 38.916986 3.235 0.583 > >>26 -76.990369 38.928989 3.68 11.22 > >>27 -77.090834 38.948038 3.29 13.499 > >>28 -76.988995 38.83509 3.251 3.268 > >>29 -77.025107 38.91746 3.684 1.165 > >>30 -77.073613 38.944412 3.472 7.902 > >>; > >>run; > > >

Back to: Top of message | Previous page | Main SAS-L page