View source: R/functions.syn.r

syn.normrank | R Documentation |

Generates univariate synthetic data using linear regression analysis and preserves the marginal distribution. Regression is carried out on Normal deviates of ranks in the original variable. Synthetic values are assigned from the original values based on the synthesised ranks that are transformed from their synthesised Normal deviates.

syn.normrank(y, x, xp, smoothing = "", proper = FALSE, ...)

`y` |
an original data vector of length |

`x` |
a matrix ( |

`xp` |
a matrix ( |

`smoothing` |
smoothing method. See |

`proper` |
a logical value specifying whether proper synthesis should be conducted. See details. |

`...` |
additional parameters. |

First generates synthetic values of Normal deviates of ranks of
the values in `y`

using the spread around the fitted
linear regression line of Normal deviates of ranks given `x`

.
Then synthetic Normal deviates of ranks are transformed back to
get synthetic ranks which are used to assign values from
`y`

.
For proper synthesis first the regression coefficients
are drawn from normal distribution with mean and variance
from the fitted model.
A smoothing methods can be applied by setting smoothing parameter (see
`syn.smooth`

). It is recommended as a tool to decrease the
disclosure risk.

A list with two components:

`res` |
a vector of length |

`fit` |
a data frame with regression coefficients and error estimates. |

`syn`

, `syn.norm`

, `syn.lognorm`

,
`syn.smooth`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.