Learn R Programming

⚠️There's a newer version (1.7.5) of this package.Take me there.

SSBtools (version 1.4.4)

Statistics Norway's Miscellaneous Tools

Description

Functions used by other packages from Statistics Norway are gathered. General data manipulation functions, and functions for hierarchical computations are included (Langsrud, 2020) . The hierarchy specification functions are useful within statistical disclosure control.

Copy Link

Version

Install

install.packages('SSBtools')

Monthly Downloads

969

Version

1.4.4

License

Apache License 2.0 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Oyvind Langsrud

Last Published

March 28th, 2023

Functions in SSBtools (1.4.4)

DataDummyHierarchy

Create a (signed) dummy matrix for hierarcical mapping of codes in data
FormulaSums

Sums (aggregates) and/or sparse model matrix with possible cross table
ForceCharacterDataFrame

ForceCharacterDataFrame
FindTableGroup

Finding table(s) of hierarchical variable groups
GaussIndependent

Linearly independent rows and columns by Gaussian elimination
FindDisclosiveCells

Find directly disclosive cells
HierarchicalGroups3

Finding hierarchical variable groups
GaussSuppression

Secondary suppression by Gaussian elimination
GaussIterationFunction

An iFunction argument to GaussSuppression
Hierarchies2ModelMatrix

Model matrix representing crossed hierarchies
HierarchicalWildcardGlobbing

Find variable combinations by advanced wildcard/globbing specifications.
HierarchiesAndFormula2ModelMatrix

Model matrix representing crossed hierarchies according to a formula
FindDimLists

Finding dimList
HierarchyCompute

Hierarchical Computations
Hierarchy2Formula

Hierarchy2Formula
FormulaSelection

Limit matrix or data frame to selected model terms
ForceFactorDataFrame

ForceFactorDataFrame
HierarchyCompute2

Extended Hierarchical Computations
FactorLevCorr

Factor level correlation
FindCommonCells

Finding commonCells
HierarchicalGroups

Finding hierarchical variable groups
HierarchyFix

Change the hierarchy table to follow the standard
MatrixPaste

Combining columns of a matrix
HierarchicalGroups2

Finding hierarchical variable groups
MakeFreq

Microdata frequency data conversion
MakeHierFormula

Make model formula from data taking into account hierarchical variables
RowGroups

Create numbering according to unique rows
SortRows

Sorting rows
Stack

Stack columns from a data frame and include variables.
SSBtoolsData

Function that returns a dataset
UniqueSeq

Sequence within unique values
ModelMatrix

Model matrix from hierarchies and/or a formula
Mipf

Iterative proportional fitting from matrix input
Unstack

Unstack a column from a data frame and include additional variables.
Match

Matching rows in data frames
WildcardGlobbing

Row selection by wildcard/globbing
Model_Matrix

Overparameterized model matrix
NumSingleton

Decoding of singletonMethod
Matrix2list

Convert matrix to sparse list
LSfitNonNeg

Non-negative regression fits with a sparse overparameterized model matrix
aggregate_multiple_fun

Wrapper to aggregate
sosialFiktiv

Fictitious datasets returned by SSBtoolsData()
crossMerge

crossMerge
unmatrix

Transform data frame with embedded matrices
WildcardGlobbingVector

Selection of elements by wildcard/globbing
quantile_weighted

Weighted quantiles
model_aggregate

Hierarchical aggregation via model specification
MatrixToDataFrame

MatrixToDataFrame
Number

Adding leading zeros
RbindAll

Combining several data frames when the columns don't match
fix_vars_amf

Fix vars parameter to aggregate_multiple_fun
Reduce0exact

Reducing a non-negative regression problem
HierarchyComputeDummy

HierarchyComputeDummy
RoundWhole

Round values that are close two whole numbers
dummy_aggregate

aggregate_multiple_fun using a dummy matrix
fix_fun_amf

Fix fun parameter to aggregate_multiple_fun
matlabColon

Simulate Matlab's ':'
AddLeadingZeros

Add leading zeros to numbers while preserving other text
AutoHierarchies

Ensure standardized coding of hierarchies
CbindIdMatch

Combine several data frames by using id variables to match rows
CrossCodeFrames

Cross codes in data frames
AutoSplit

Creating variables by splitting the elements of a character vector without needing a split string
AddNonExistingCode

AddNonExistingCode
As_TsparseMatrix

Transform to TsparseMatrix/dgTMatrix
AddMapsInput

AddMapsInput
CharacterDataFrame

CharacterDataFrame
CrossDataDummyHierarchies

CrossDataDummyHierarchies
DummyApply

Apply a function to subsets defined by a dummy matrix
DimList2Hrc

DimList2Hrc/Hrc2DimList
CrossDataDummyHierarchy

CrossDataDummyHierarchy
DataFrameToMatrix

DataFrameToMatrix
DimList2Hierarchy

DimList2Hierarchy
DummyDuplicated

Duplicated columns in dummy matrix
Extend0

Add zero frequency rows
Extend0rnd1

varGroups-attribute to Extend0, Example functions
DummyHierarchy

Converting hierarchy specifications to a (signed) dummy matrix