Last data update: 2014.03.03

R: Add All Possible Single Terms to a GWRM Model
add1.gwR Documentation

Add All Possible Single Terms to a GWRM Model

Description

Compute all the single terms in the scope argument that can be added to the GWRM model, fit those models and compute a table of the changes in fit.

Usage

## S3 method for class 'gw'
add1(object, scope, test = c("none", "Chisq"), k = 2,
  trace = FALSE, ...)

Arguments

object

a fitted object of class inheriting from "gw".

scope

a formula giving the terms to be considered for adding.

test

"none", which considers the AIC criterion, or Chisq, which is the likelihood-ratio test.

k

the penalty constant in AIC / Cp.

trace

if TRUE, print out progress reports.

...

further arguments passed to or from other methods.

Value

An object of class "anova" summarizing the differences in fit between the models.

Examples

data(goals)
fit0 <- gw(goals ~ offset(log(played)), data = goals)
summary(fit0)

fit1 <- add1(fit0, ~ position)
summary(fit1)

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(GWRM)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GWRM/add1.gw.Rd_%03d_medium.png", width=480, height=480)
> ### Name: add1.gw
> ### Title: Add All Possible Single Terms to a GWRM Model
> ### Aliases: add1.gw
> 
> ### ** Examples
> 
> data(goals)
> fit0 <- gw(goals ~ offset(log(played)), data = goals)
> summary(fit0)

Call:  gw(formula = goals ~ offset(log(played)), data = goals)

Coefficients:
             Estimate   Std. Error  z value    Pr(>|z|) 
(Intercept)   -2.25269    0.04279   -52.63944    0.00000

Fit:
  log-likelihood  AIC    BIC    df   
  -2051            4108   4123   1221

betaII:
  par        Estimate   Std. Error
  k          12.951182  6.653273  
  ro          6.604384  2.131549  

Degrees of Freedom: Total (i.e. Null);  1221 Residual

Code of convergence: 0  

Method: L-BFGS-B 
> 
> fit1 <- add1(fit0, ~ position)
> summary(fit1)
       Df         AIC      
 Min.   :2   Min.   :3820  
 1st Qu.:2   1st Qu.:3892  
 Median :2   Median :3964  
 Mean   :2   Mean   :3964  
 3rd Qu.:2   3rd Qu.:4036  
 Max.   :2   Max.   :4108  
 NA's   :1                 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>