Date: Tue, 13 Jan 2004 14:12:31 -0800 "Choate, Paul@DDS" "SAS(r) Discussion" "Choate, Paul@DDS" Re: TRANSPOSE and Analysis of the Distribution To: Dave Sorensen

Hi again Dave,

Do you want to count the non-missing burglary entries at each address? You don't need to transpose again, use the "n" function.

Data burgs; Set burgs; Num_Burgs=n(of COL1-COL30); Run;

There are many other statistical functions in datastep statements - look at descriptive and probability in SAS Online.Doc:

hth

Paul Choate DDS Data Extraction (916) 654-2160

-----Original Message----- From: Dave Sorensen [mailto:Dave.Sorensen@JUR.KU.DK] Sent: Tuesday, January 13, 2004 11:39 AM To: SAS-L@LISTSERV.UGA.EDU Subject: TRANSPOSE and Analysis of the Distribution

Hi SAS-L,

I have a dataset with 30,958 cases of burglary reported to the police during a one year period. I am interested in how many burglaries occured at each unique address. Since my unit of analysis was burglary reports (each of which contains an addresses), I ran PROC TRANSPOSE so I could find out how many times each address shows up in the dataset.

So now I have a transposed dataset containing 32 variables: COL1...COL30, Address, and _Name_.

I'd like to create a variable called "Num_Burgs" (which combines COL1...COL30) so that I could analyze its distribution and detrmine whether it is attributable to chance. I presume that requires transposing my data again. But how? Could someone give me the code?

My dataset has 30,958 burglaries occurring at 29,491 unique residences. Data from around the world indicate a very skewed distribution for burglary - where a small proportion of households experience a comparatively large proportion of all burglaries. But my Danish data don't seem to follow that trend. Some hand calculations based on the first transpose indicate the following:

Times This % Experienced this Burgled of address % of all burglaries

1 95.5% 91.0% 2 4.11 7.82 3 0.28 0.80 3 to 30 0.07 0.36

Thanks, Dave S., cross-eyed at U of Copenhagen

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