Learn R Programming

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

SSBtools (version 1.5.0)

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

937

Version

1.5.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Oyvind Langsrud

Last Published

January 8th, 2024

Functions in SSBtools (1.5.0)

GaussSuppression

Secondary suppression by Gaussian elimination
FindHierarchies

Finding hierarchies automatically from data
HierarchicalGroups

Finding hierarchical variable groups
GaussIterationFunction

An iFunction argument to GaussSuppression
GaussIndependent

Linearly independent rows and columns by Gaussian elimination
HierarchicalGroups3

Finding hierarchical variable groups
Hierarchy2Formula

Hierarchy2Formula
FormulaSelection

Limit matrix or data frame to selected model terms
HierarchyComputeDummy

HierarchyComputeDummy
FindCommonCells

Finding commonCells
HierarchiesAndFormula2ModelMatrix

Model matrix representing crossed hierarchies according to a formula
FormulaSums

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

Change the hierarchy table to follow the standard
HierarchicalGroups2

Finding hierarchical variable groups
Hierarchies2ModelMatrix

Model matrix representing crossed hierarchies
HierarchyCompute

Hierarchical Computations
LSfitNonNeg

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

Find variable combinations by advanced wildcard/globbing specifications.
MatrixToDataFrame

MatrixToDataFrame
Model_Matrix

Overparameterized model matrix
MatrixPaste

Combining columns of a matrix
ForceFactorDataFrame

ForceFactorDataFrame
HierarchyCompute2

Extended Hierarchical Computations
FindTableGroup

Finding table(s) of hierarchical variable groups
ForceCharacterDataFrame

ForceCharacterDataFrame
Matrix2list

Convert matrix to sparse list
SSBtoolsData

Function that returns a dataset
MakeHierFormula

Make model formula from data taking into account hierarchical variables
ModelMatrix

Model matrix from hierarchies and/or a formula
Mipf

Iterative proportional fitting from matrix input
SortRows

Sorting rows of a matrix or data frame
Stack

Stack columns from a data frame and include variables.
Number

Adding leading zeros
MakeFreq

Microdata frequency data conversion
fix_fun_amf

Fix fun parameter to aggregate_multiple_fun
RowGroups

Create numbering according to unique rows
WildcardGlobbingVector

Selection of elements by wildcard/globbing
fix_vars_amf

Fix vars parameter to aggregate_multiple_fun
NumSingleton

Decoding of singletonMethod
RoundWhole

Round values that are close two whole numbers
Reduce0exact

Reducing a non-negative regression problem
matlabColon

Simulate Matlab's ':'
inc_default

Default progress indicator function
crossMerge

crossMerge
Match

Matching rows in data frames
dummy_aggregate

aggregate_multiple_fun using a dummy matrix
RbindAll

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

Wrapper to aggregate
model_aggregate

Hierarchical aggregation via model specification
unmatrix

Transform data frame with embedded matrices
quantile_weighted

Weighted quantiles
UniqueSeq

Sequence within unique values
sosialFiktiv

Fictitious datasets returned by SSBtoolsData()
WildcardGlobbing

Row selection by wildcard/globbing
Unstack

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

Ensure standardized coding of hierarchies
CrossCodeFrames

Cross codes in data frames
As_TsparseMatrix

Transform to TsparseMatrix/dgTMatrix
CbindIdMatch

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

DimList2Hierarchy
DataDummyHierarchy

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

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

Add leading zeros to numbers while preserving other text
CharacterDataFrame

CharacterDataFrame
DataFrameToMatrix

DataFrameToMatrix
FindDisclosiveCells

Find directly disclosive cells
DummyApply

Apply a function to subsets defined by a dummy matrix
FindDimLists

Finding dimList
FactorLevCorr

Factor level correlation
DummyDuplicated

Duplicated columns in dummy matrix
DimList2Hrc

DimList2Hrc/Hrc2DimList
DummyHierarchy

Converting hierarchy specifications to a (signed) dummy matrix
Extend0

Add zero frequency rows
Extend0rnd1

varGroups-attribute to Extend0, Example functions