Last data update: 2014.03.03

R: Baseball team wins versus 7 independent variables for...
WinsR Documentation

Baseball team wins versus 7 independent variables for National league teams in 1990

Description

Data for Exercise 9.23

Usage

Wins

Format

A data frame with 12 observations on the following 9 variables.

team

a factor with levels Atlanta Chicago Cincinnati Houston Los Angeles Montreal New York Philadelphia Pittsburgh San Diego San Francisco St. Louis

wins

a numeric vector

batavg

a numeric vector

rbi

a numeric vector

stole

a numeric vector

strkout

a numeric vector

caught

a numeric vector

errors

a numeric vector

era

a numeric vector

Source

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Duxbury

Examples

str(Wins)
attach(Wins)
plot(era,wins)
model <- lm(wins~era)
abline(model)
summary(model)
detach(Wins)
remove(model)

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(BSDA)
Loading required package: e1071
Loading required package: lattice

Attaching package: 'BSDA'

The following object is masked from 'package:datasets':

    Orange

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BSDA/Wins.Rd_%03d_medium.png", width=480, height=480)
> ### Name: Wins
> ### Title: Baseball team wins versus 7 independent variables for National
> ###   league teams in 1990
> ### Aliases: Wins
> ### Keywords: datasets
> 
> ### ** Examples
> 
> str(Wins)
'data.frame':	12 obs. of  9 variables:
 $ team   : Factor w/ 12 levels "Atlanta","Chicago",..: 1 2 3 4 5 6 7 8 9 12 ...
 $ wins   : int  65 77 91 75 86 85 91 77 95 70 ...
 $ batavg : num  0.25 0.263 0.265 0.242 0.262 0.25 0.256 0.255 0.259 0.256 ...
 $ rbi    : int  636 649 644 536 669 607 734 619 693 554 ...
 $ stole  : int  92 151 166 179 141 235 110 108 137 221 ...
 $ strkout: int  1010 869 913 997 952 1024 851 915 914 844 ...
 $ caught : int  55 50 66 83 65 99 33 35 52 74 ...
 $ errors : int  158 124 102 131 130 110 132 117 134 130 ...
 $ era    : num  4.58 4.34 3.39 3.61 3.72 3.37 3.43 4.07 3.4 3.87 ...
> attach(Wins)
> plot(era,wins)
> model <- lm(wins~era)
> abline(model)
> summary(model)

Call:
lm(formula = wins ~ era)

Residuals:
   Min     1Q Median     3Q    Max 
-9.765 -4.277  1.929  4.236  8.694 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  143.500     19.398   7.398 2.32e-05 ***
era          -16.469      5.086  -3.238  0.00889 ** 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 6.752 on 10 degrees of freedom
Multiple R-squared:  0.5119,	Adjusted R-squared:  0.4631 
F-statistic: 10.49 on 1 and 10 DF,  p-value: 0.008895

> detach(Wins)
> remove(model)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>