Skip to content

importing NPDB

3 messages · alison korte, Marc Schwartz, Clint Bowman

#
On Dec 27, 2011, at 4:55 PM, alison korte wrote:

            
The files that are available from:

  http://www.npdb-hipdb.hrsa.gov/resources/publicData.jsp

are either tab delimited ASCII files (.DAT) or SPSS (.POR) files. 

For R, you would want to use the former and import the files using ?read.delim, which defaults to using a '\t' (TAB) character as the delimiter. See the R Data Import/Export manual for more information:

  http://cran.r-project.org/manuals.html

Technical details about the file structure are available in:

  http://www.npdb-hipdb.hrsa.gov/resources/reports/PublicUseDataFile-DAT-Format.pdf

BTW, that took about two minutes of searching using Google.

HTH,

Marc Schwartz
#
Alison,

library(foreign)
ndpb<-read.spss("NPDB1107.por")

generates:

Warning message:
In `levels<-`(`*tmp*`, value = c("Self Query Processing", "Non-Fed. 
Malp. Payor",  :
   duplicated levels will not be allowed in factors anymore

and summary(ndpb) does generate quite a list.

Perhaps you can take it from there.

Clint