wle.lm: Fitting Linear Models using Weighted Likelihood

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/wle.lm.R

Description

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.

Usage

1
2
3
4
wle.lm(formula, data=list(), model=TRUE, x=FALSE, 
       y=FALSE, boot=30, group, num.sol=1, raf="HD", 
       smooth=0.031, tol=10^(-6), equal=10^(-3), 
       max.iter=500, contrasts=NULL, verbose=FALSE)

Arguments

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 wle.lm is called from.

model, x, y

logicals. If TRUE the corresponding components of the fit (the model frame, the model matrix, the response.)

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:

raf="HD": Hellinger Distance RAF,

raf="NED": Negative Exponential Disparity RAF,

raf="SCHI2": Symmetric Chi-Squared Disparity RAF.

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 tol).

max.iter

maximum number of iterations.

contrasts

an optional list. See the contrasts.arg of model.matrix.default.

verbose

if TRUE warnings are printed.

Details

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.

Value

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 max.iter iterations are reached.

call

the match.call().

contrasts
xlevels
terms

the model frame.

model

if model=TRUE a matrix with first column the dependent variable and the remain column the explanatory variables for the full model.

x

if x=TRUE a matrix with the explanatory variables for the full model.

y

if y=TRUE a vector with the dependent variable.

info

not well working yet, if 0 no error occurred.

Author(s)

Claudio Agostinelli

References

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.

See Also

wle.smooth an algorithm to choose the smoothing parameter for normal distribution and normal kernel.

Examples

 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)

Example output

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 

wle documentation built on May 29, 2017, 11:48 a.m.

Related to wle.lm in wle...