s-news
[Top] [All Lists]

How to create a "summary" data frame

To: <s-news@lists.biostat.wustl.edu>
Subject: How to create a "summary" data frame
From: "Hunsicker, Lawrence" <lawrence-hunsicker@uiowa.edu>
Date: Mon, 22 Dec 2008 16:06:03 -0600
Thread-index: AclkgXtcoC+OxQCaRiC9gxzViQ/c+w==
Thread-topic: How to create a "summary" data frame

Hi, folks, and Happy Holidays to all:

I have a data frame with about 11,000 patients from about 600 different centers.  Roughly half of these patients have had a certain test done, and the other half have not had the test.  But the fraction with the test varies from center to center.  Id like to add a column to the data frame indicating the fraction of patients at each center that had the test done.  I tried doing this using the GUI to calculate the average of 0 (no) and 1 (yes) values, doing the average by center, and saving the result.  I get a list with a single value (the average) for each center, but the center IDs are not included, so that I cant do a merge on center ID.  How can I create a data frame with two columns, the first column being the center number, and the second being the fraction of patients with the test done?

Larry Hunsicker

<Prev in Thread] Current Thread [Next in Thread>