The NorScir package provide interactive results from the registry NorScir at Rapporteket.

library(NorScir)

This package depend on the the rapbase package. Underlying processing of registry data is describe in this document.

Sample data

This package comes with a sample data set for testing purposes

data(NorScirSampleData)
head(names(NorScirSampleData), 10)

It contains realistic data but with nonsense personal info. Sample data should only be used during package development and never in a full scale testing or production environment.

As the NorScir package evolves, so should also the sample data. Hence, future versions should also contain an updated (and extended) set of sample data, at least when new features are added to the package. Sample data is stored in the data/ directory by the save() function (not run):

save(NorScirSampleData, file='NorScirSampleData.rda')

General functions

These scripts contain supporting functions to be used by the report functions.

NSLibUtvalg.R

Provided a (raw) set of data this function returns a subset based on the criteria provided by its arguments

NSLoadRegData.R

Defines the SQL query and loads the global registry data set. Since this function assumes real data it will only run successfully in a test or production environment, or on a replica of it.

In order to query registry data a unike registry identifier must be provided. For NorScir registrey this idetifier is "NorScir" and must be assigned to the variable registyName withint the function NSLoadRegData():

registryName <- "NorScir"

Report functions

Each R-function within the scripts listed below provide at least one, but usually several, set of results at Rapporteket.

NSFigAndelStabel.R

Provides figure of stacked bars, e.g.:

FigAndelStabel(RegData=NorScirSampleData, outfile='', libkat='',
               valgtVar='NevrNivaaInnUt', datoFra='2010-01-01',
               datoTil='3000-01-01', minald=0, maxald=120, erMann='',
               traume='', enhetsUtvalg='0', reshID=12345, hentData=0)

NSFigFordeling.R

Provide distribution as bars, e.g.:

FigFordeling(RegData=NorScirSampleData, libkat='', outfile='', valgtVar='AAis',
             datoFra='2010-01-01', datoTil='2050-01-01', AIS='', minald=0,
             maxald=120, erMann='', traume='', enhetsUtvalg=0, reshID=12345,
             sml=1, hentData=0)

Analysis

For variables "AAis" and "FAis" an additional cathegory "None" was introduced at some point. In the above function "None" is recoded as "U" as requested by the registry during autumn 2015.

NSFigMeanMed.R

Provide mean and median per hospital, e.g.:

FigMeanMed(RegData=NorScirSampleData, valgtVar='Alder', valgtMaal='Gjsn',
           datoFra='2010-01-01', datoTil='2015-12-31', AIS='', minald=0,
           maxald=130, erMann='', traume='', libkat='', outfile='', hentData=0)


Rapporteket/norscir documentation built on Nov. 2, 2023, 11:53 a.m.