View source: R/functions.syn.r
| syn.satcat | R Documentation | 
Synthesises one variable (y) from all possible 
combinations of its predictors (x). A bootstrap sample is created 
from the original values of y within each unique combinations of 
of xp (the synthesisied values of the grouping variable).
Note that only combinations of predictor variable levels that appear in the 
original data can be in the synthetic data. 
The related method 
(syn.catall) overcomes this by adding a small prior probability 
to all zero cells in the cross tabulation from the original data that are not 
structural zeros. But it has the limitation of requiring a complete 
cross tabulation of all the variables.
syn.satcat(y, x, xp, proper = FALSE, ...)
y | 
 an original data vector of length   | 
x | 
 a matrix (  | 
xp | 
 a matrix (  | 
proper | 
 if   | 
... | 
 additional parameters.  | 
It is intended that the variables in x are categorical (factor) 
variables. If y is also a categorical variable syn.satcat will 
give the same results as fitting a saturated polychotomous regression model but 
will usually be much faster. syn.satcat will fail with an error message 
if previous syntheses have generated a combination of variables in xp 
that was not present in x. Use of the syn.catall method for 
grouped variables can overcome this.
A list with two components:
res | 
 a data frame of dimension   | 
fit | 
 the cross-tabulation of the original predictor variables.  | 
ods <- SD2011[, c("region", "sex", "agegr", "placesize")]
s1 <- syn(ods, method =  "satcat", seed = 7856)
s2 <- syn(ods, method = c("sample", "cart", "satcat", "cart"), seed = 7856)
## Not run: 
### mostly fails because previous synthesis has produced 
### combinations not found in the original data
s3 <- syn(ods, method = c("sample", "cart", "cart", "satcat"), seed = 7856)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.