Description Usage Arguments Details Value Author(s) References See Also Examples
wle.lm
is used to fit linear models via Weighted Likelihood, when the errors are iid from a normal distribution with null mean and unknown variance. The carriers are considered fixed. Note that this estimator is robust against the presence of bad leverage points too.
1 2 3 4 |
formula |
a symbolic description of the model to be fit. The details of model specification are given below. |
data |
an optional data frame containing the variables
in the model. By default the variables are taken from
the environment which |
model, x, y |
logicals. If |
boot |
the number of starting points based on boostrap subsamples to use in the search of the roots. |
group |
the dimension of the bootstap subsamples. The default value is max(round(size/4),var) where size is the number of observations and var is the number of variables. |
num.sol |
maximum number of roots to be searched. |
raf |
type of Residual adjustment function to be used:
|
smooth |
the value of the smoothing parameter. |
tol |
the absolute accuracy to be used to achieve convergence of the algorithm. |
equal |
the absolute value for which two roots are considered the same. (This parameter must be greater than |
max.iter |
maximum number of iterations. |
contrasts |
an optional list. See the |
verbose |
if |
Models for wle.lm
are specified symbolically. A typical model has the form response ~ terms
where response
is the (numeric) response vector and terms
is a series of terms which specifies a linear predictor for response
. A terms specification of the form first+second
indicates all the terms in first
together with all the terms in second
with duplicates removed. A specification of the form first:second
indicates the the set of terms obtained by taking the interactions of all terms in first
with all terms in second
. The specification first*second
indicates the cross of first
and second
. This is the same as first+second+first:second
.
wle.lm
returns an object of class
"wle.lm"
.
The function summary
is used to obtain and print a summary of the results.
The generic accessor functions coefficients
, residuals
and fitted.values
extract coefficients, residuals and fitted values returned by wle.lm
.
The object returned by wle.lm
are:
coefficients |
the parameters estimator, one row vector for each root found. |
standard.error |
an estimation of the standard error of the parameters estimator, one row vector for each root found. |
scale |
an estimation of the error scale, one value for each root found. |
residuals |
the unweighted residuals from the estimated model, one column vector for each root found. |
fitted.values |
the fitted values from the estimated model, one column vector for each root found. |
tot.weights |
the sum of the weights divide by the number of observations, one value for each root found. |
weights |
the weights associated to each observation, one column vector for each root found. |
f.density |
the non-parametric density estimation. |
m.density |
the smoothed model. |
delta |
the Pearson residuals. |
freq |
the number of starting points converging to the roots. |
tot.sol |
the number of solutions found. |
not.conv |
the number of starting points that does not converge after the |
call |
the match.call(). |
contrasts |
|
xlevels |
|
terms |
the model frame. |
model |
if |
x |
if |
y |
if |
info |
not well working yet, if 0 no error occurred. |
Claudio Agostinelli
Agostinelli, C., (1998) Inferenza statistica robusta basata sulla funzione di verosimiglianza pesata: alcuni sviluppi, Ph.D Thesis, Department of Statistics, University of Padova.
Agostinelli, C., Markatou, M., (1998) A one-step robust estimator for regression based on the weighted likelihood reweighting scheme, Statistics \& Probability Letters, Vol. 37, n. 4, 341-350.
Agostinelli, C., (1998) Verosimiglianza pesata nel modello di regressione lineare, XXXIX Riunione scientifica della Societ\'a Italiana di Statistica, Sorrento 1998.
wle.smooth an algorithm to choose the smoothing parameter for normal distribution and normal kernel.
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(wle)
# You can find this data set in:
# Hawkins, D.M., Bradu, D., and Kass, G.V. (1984).
# Location of several outliers in multiple regression data using
# elemental sets. Technometrics, 26, 197-208.
#
data(artificial)
result <- wle.lm(y.artificial~x.artificial,boot=40,num.sol=3)
summary(result)
plot(result)
|
Loading required package: circular
Attaching package: 'circular'
The following objects are masked from 'package:stats':
sd, var
Call:
wle.lm(formula = y.artificial ~ x.artificial, boot = 40, num.sol = 3)
Root 1
Weighted Residuals:
Min 1Q Median 3Q Max
-1.2517 -0.4987 0.0000 0.5422 1.3085
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.94351 0.12792 -7.376 3.46e-10 ***
x.artificial1 0.15653 0.07809 2.005 0.049112 *
x.artificial2 0.18912 0.07168 2.638 0.010382 *
x.artificial3 0.18152 0.05021 3.615 0.000581 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6688 on 66.03095 degrees of freedom
Multiple R-Squared: 0.9665, Adjusted R-squared: 0.965
F-statistic: 634.7 on 3 and 66.03095 degrees of freedom, p-value: 0
Call:
wle.lm(formula = y.artificial ~ x.artificial, boot = 40, num.sol = 3)
Root 2
Weighted Residuals:
Min 1Q Median 3Q Max
-0.9095 -0.3758 0.0000 0.3889 1.0291
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.19670 0.10419 -1.888 0.064 .
x.artificial1 0.08969 0.06655 1.348 0.183
x.artificial2 0.03875 0.04076 0.951 0.346
x.artificial3 -0.05298 0.03549 -1.493 0.141
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.5561 on 58.62429 degrees of freedom
Multiple R-Squared: 0.04914, Adjusted R-squared: 0.0004795
F-statistic: 1.01 on 3 and 58.62429 degrees of freedom, p-value: 0.3949
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.