Description Usage Arguments Details Value Examples
REGRAM function integrates 12 functions below included in RrT.r and RrH.r for easy use for users. Please note that the values for the tuning parameter c2 allowed in this function is standardized and limited. If you prefer to use other values, please use the functions contained in RrT.r and/or RrH.r directly. The turning parameters of those functions are not standardized.
1 2 |
x1 |
single explanatory variable |
y1 |
objective variable to be imputed |
gm |
indication of gamma value as follows: |
wf |
weight function (wf=T : Tukey, wf=H : Huber) |
scale |
scale parameter (scale=AAD; scale=MAD) |
c2 |
tuning parameter (c2=4, 6, 8) for weight function. Smaller figure is more robust. |
rp.max |
maximum number of iteration |
cg.rt |
convergence condition to stop iteration (default: cg1=0.001) |
Child functions included RrT.r using Tukey's biweight function and RrH.r of Huber weight function. AAD stands for Average Absolute Deviation and MAD, Median Absolute Deviation.
RrTa.aad: Tukey's biweight function & AAD, gamma=1
RrTb.aad: Tukey's biweight function & AAD, gamma=1/2
RrTc.aad: Tukey's biweight function & AAD, gamma=0
RrTa.mad: Tukey's biweight function & MAD, gamma=1
RrTb.mad: Tukey's biweight function & MAD, gamma=1/2
RrTc.mad: Tukey's biweight function & MAD, gamma=0
RrHa.aad: Huber's weight function & AAD, gamma=1
RrHb.aad: Huber's weight function & AAD, gamma=1/2
RrHc.aad: Huber's weight function & AAD, gamma=0
RrHa.mad: Huber's weight function & MAD, gamma=1
RrHb.mad: Huber's weight function & MAD, gamma=1/2
RrHc.mad: Huber's weight function & MAD, gamma=0
a list with the following elements
par
robustly estimated ratio of y1 to x1 (beta)
res
homoscedastic quasi-residuals
wt
robust weights
rp
total number of iteration
s1
changes of the scale (AAD or MAD)
efg
error flag. 1: acalculia (all weights become zero) 0: successful termination
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
require(REGRM)
x <- seq(1, 10, by=0.1)
#e <- rnorm(length(x))
e <- rt(length(x), df=3) # error term following t distribution
b <- 2 # true value of slope
y1 <- b*x + x*e # example 1: gamma=1
y2 <- b*x + sqrt(x)*e # example 2: gamma=1/2
o1 <- REGRM(x, y1, gm="a")
o2 <- REGRM(x, y2, gm="b")
o1$par; o2$par # estimated slope
require(RColorBrewer)
cols = brewer.pal(11, "PiYG")
cl1 <- round((o1$wt)*10+1)
cl2 <- round((o2$wt)*10+1)
par(mfrow=c(1,2))
plot(x, y1, col=cols[cl1], pch=20)
plot(x, y2, col=cols[cl2], pch=20)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.