Last data update: 2014.03.03

R: CM and CRM Linear regression model
sym.lmR Documentation

CM and CRM Linear regression model

Description

To execute the Center Method (CR) and Center and Range Method (CRM) to Linear regression

Usage

sym.lm(formula, sym.data, method = c("cm", "crm"))

Arguments

formula

An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

sym.data

Should be a symbolic data table read with the function read.sym.table(...).

method

"cm" to Center Method and "crm" to Center and Range Method.

Details

Models for 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 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

sym.lm returns an object of class "lm" or for multiple responses of class c("mlm", "lm")

Author(s)

Oldemar Rodriguez Rojas

References

LIMA-NETO, E.A., DE CARVALHO, F.A.T., (2008). Centre and range method to fitting a linear regression model on symbolic interval data. Computational Statistics and Data Analysis 52, 1500-1515.

LIMA-NETO, E.A., DE CARVALHO, F.A.T., (2010). Constrained linear regression models for symbolic interval-valued variables. Computational Statistics and Data Analysis 54, 333-347.

See Also

sym.glm

Examples

data(int_prost_train)
data(int_prost_test)
res.cm<-sym.lm(lpsa~.,sym.data=int_prost_train,method='cm')
pred.cm<-predictsym.lm(res.cm,int_prost_test,method='cm')
RMSE.L(sym.var(int_prost_test,9),pred.cm$Fitted)
RMSE.U(sym.var(int_prost_test,9),pred.cm$Fitted)
R2.L(sym.var(int_prost_test,9),pred.cm$Fitted)
R2.U(sym.var(int_prost_test,9),pred.cm$Fitted)
deter.coefficient(sym.var(int_prost_test,9),pred.cm$Fitted)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RSDA)
Loading required package: XML
Loading required package: scales
Loading required package: ggplot2
Loading required package: princurve
Loading required package: sqldf
Loading required package: gsubfn
Loading required package: proto
Could not load tcltk.  Will use slower R code instead.
Loading required package: RSQLite
Loading required package: DBI
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RSDA/sym.lm.Rd_%03d_medium.png", width=480, height=480)
> ### Name: sym.lm
> ### Title: CM and CRM Linear regression model
> ### Aliases: sym.lm
> ### Keywords: Symbolic lm
> 
> ### ** Examples
> 
> data(int_prost_train)
> data(int_prost_test)
> res.cm<-sym.lm(lpsa~.,sym.data=int_prost_train,method='cm')
> pred.cm<-predictsym.lm(res.cm,int_prost_test,method='cm')
> RMSE.L(sym.var(int_prost_test,9),pred.cm$Fitted)
[1] 0.7229999
> RMSE.U(sym.var(int_prost_test,9),pred.cm$Fitted)
[1] 0.7192467
> R2.L(sym.var(int_prost_test,9),pred.cm$Fitted)
[1] 0.501419
> R2.U(sym.var(int_prost_test,9),pred.cm$Fitted)
[1] 0.5058389
> deter.coefficient(sym.var(int_prost_test,9),pred.cm$Fitted)
[1] 0.4962964
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>