Last data update: 2014.03.03

R: Highway accdient rates
traffic.dfR Documentation

Highway accdient rates

Description

Data gathered in the course of studying the relationship between accident rates on US highways and various characteristics of the highway

Usage

data(traffic.df)

Format

A data frame with 39 observations on the following 15 variables:

obs

observation number

rate

The accident rate per million vehicle miles (response)

len

The length of the segment of highway in miles

adt

Average daily traffic count ('000)

trks

The percentage of the traffic that are trucks

slim

the speed limit in mph

lwd

the lane width in feet

shld

the shoulder width in feet

itg

number of freeway interchanges per mile

sigs

number of entrances controlled by lights per mile

acpt

number of access points per mile

lane

number of lanes in each direction

fai

dummy variable, equal to 1 if an interstate highway, zero otherwise

pa

equal to 1 if a principal highway, 0 otherwise

ma

equal to 1 if a major highway, 0 otherwise

Source

Carl Hoffstedt. This differs from the dataset highway in the alr3 package only by transformation of some of the columns.

References

Fox, J. and Weisberg, S. (2011) An R Companion to Applied Regression, Second Edition, Sage.

Weisberg, S. (2005) Applied Linear Regression, Third Edition. Wiley, Section 7.2.

Examples

data(traffic.df)
traffic.lm<-lm(rate~.,data=traffic.df)
summary(traffic.lm)

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(R330)
Loading required package: s20x
Loading required package: leaps
Loading required package: rgl
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/R330/traffic.df.Rd_%03d_medium.png", width=480, height=480)
> ### Name: traffic.df
> ### Title: Highway accdient rates
> ### Aliases: traffic.df
> ### Keywords: datasets
> 
> ### ** Examples
> 
> data(traffic.df)
> traffic.lm<-lm(rate~.,data=traffic.df)
> summary(traffic.lm)

Call:
lm(formula = rate ~ ., data = traffic.df)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.75103 -0.58929  0.09315  0.48327  2.10983 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept) 22.29638    6.77600   3.290  0.00308 **
obs         -0.21681    0.07598  -2.854  0.00876 **
len         -0.02440    0.03265  -0.747  0.46213   
adt         -0.05984    0.03507  -1.706  0.10089   
trks        -0.11089    0.10124  -1.095  0.28421   
slim        -0.14910    0.07262  -2.053  0.05112 . 
lwd         -0.07933    0.52762  -0.150  0.88175   
shld         0.02655    0.14307   0.186  0.85432   
itg         -0.13183    1.11942  -0.118  0.90723   
sigs         0.16067    0.50288   0.319  0.75212   
acpt         0.05696    0.03770   1.511  0.14389   
lane         0.07427    0.25033   0.297  0.76926   
fai         -4.52009    2.34660  -1.926  0.06600 . 
pa          -4.82295    1.65417  -2.916  0.00758 **
ma          -1.67792    0.94736  -1.771  0.08924 . 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.057 on 24 degrees of freedom
Multiple R-squared:  0.8212,	Adjusted R-squared:  0.7168 
F-statistic: 7.872 on 14 and 24 DF,  p-value: 6.753e-06

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>