[IPSUR-commits] r141 - in www/book: . download
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Jan 10 20:05:31 CET 2010
Author: gkerns
Date: 2010-01-10 20:05:30 +0100 (Sun, 10 Jan 2010)
New Revision: 141
Added:
www/book/download/IPSUR.lyx
www/book/download/IPSUR.pdf
www/book/download/IPSUR.zip
Modified:
www/book/downloads.php
Log:
fixed links and upload sources
Added: www/book/download/IPSUR.lyx
===================================================================
--- www/book/download/IPSUR.lyx (rev 0)
+++ www/book/download/IPSUR.lyx 2010-01-10 19:05:30 UTC (rev 141)
@@ -0,0 +1,88590 @@
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
+\lyxformat 345
+\begin_document
+\begin_header
+\textclass literate-book
+\begin_preamble
+% Meta information - fill between {} and do not remove %
+% \VignetteIndexEntry{An Introduction to Probability and Statistics Using R}
+% \VignetteDepends{}
+% \VignetteKeywords{}
+% \VignettePackage{IPSUR}
+% Package
+
+% user-loaded packages
+\usepackage{amssymb}
+\usepackage{amsmath}
+\usepackage{latexsym}
+%\usepackage{theorem}
+\usepackage{subfig}
+\usepackage{graphics}
+\usepackage{epsfig}
+\usepackage{makeidx}
+%\usepackage{showidx}
+\usepackage{multicol}
+%\usepackage{floatflt}
+\usepackage{url}
+\usepackage{srcltx}
+\usepackage{txfonts}
+\usepackage{stmaryrd}
+\usepackage{textcomp}
+%\usepackage{pslatex}
+\usepackage{upgreek}
+\usepackage[subfigure]{tocloft}
+\setlength{\cftfignumwidth}{1.5cm}
+
+
+% user defined commands
+% special operators
+\renewcommand{\P}{%
+ \mathop{\operator at font I\hspace{-1.5pt}P\hspace{.13pt}}}
+\newcommand{\E}{%
+ \mathop{\operator at font I\hspace{-1.5pt}E\hspace{.13pt}}}
+\newcommand{\VAR}{\operatorname{var}}
+\newcommand{\COV}{\operatorname{cov}}
+\newcommand{\COR}{\operatorname{cor}}
+\renewcommand{\vec}[1]{\mbox{\boldmath$#1$}}
+
+% special symbols
+\newcommand{\me}{\mathrm{e}}
+\newcommand{\R}{\mathbb{R}}
+\newcommand{\diff}{\mathrm{d}}
+\newcommand{\ybar}{\overline{y}}
+\newcommand{\xbar}{\overline{x}}
+\newcommand{\Xbar}{\overline{X}}
+\newcommand{\Ybar}{\overline{Y}}
+
+% special logos
+\providecommand{\IPSUR}
+{\textsc{I\kern 0ex\lower-.3ex\hbox{\small P}\kern -.5ex\lower.4ex\hbox{\footnotesize S}\kern -.25exU}\kern -.1ex\lower .15ex\hbox{\textsf{\large R}}\@}
+
+\providecommand{\IPSURtitle}
+{\fontsize{30}{35}\selectfont \textsc{I\kern -.16ex\lower-.5ex\hbox{\Large P}\kern -.5ex\lower.4ex\hbox{\Large S}\kern -.25exU}\kern -.1ex\lower .15ex\hbox{\textsf{\Huge R}}\@}
+
+
+%% Sweave specific commands
+% make the input blue
+\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{red}}
+% make the output red
+\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{blue}}
+% get rid of extra Sweave space
+\fvset{listparameters={\setlength{\topsep}{0pt}}}
+\renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}}
+
+% settings for program listings
+\lstset{
+language=R,
+breaklines=true,
+breakatwhitespace=true,
+keywordstyle={\ttfamily},
+numberstyle = {\ttfamily},
+morestring=[b]"
+}
+\end_preamble
+\options nogin
+\use_default_options false
+\begin_modules
+theorems-ams
+eqs-within-sections
+figs-within-sections
+theorems-ams-extended
+theorems-chap
+\end_modules
+\language english
+\inputencoding utf8
+\font_roman lmodern
+\font_sans lmss
+\font_typewriter lmtt
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+
+\graphics default
+\paperfontsize 12
+\spacing other 1.2
+\use_hyperref true
+\pdf_title "Introduction to Probability and Statistics Using R"
+\pdf_author "G. Jay Kerns"
+\pdf_bookmarks true
+\pdf_bookmarksnumbered true
+\pdf_bookmarksopen true
+\pdf_bookmarksopenlevel 0
+\pdf_breaklinks true
+\pdf_pdfborder true
+\pdf_colorlinks true
+\pdf_backref page
+\pdf_pdfusetitle true
+\pdf_quoted_options "linkcolor=blue, citecolor=black, urlcolor=blue"
+\papersize a4paper
+\use_geometry true
+\use_amsmath 1
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
+\paperorientation portrait
+\branch examples
+\selected 1
+\color #faf0e6
+\end_branch
+\branch howtowithR
+\selected 1
+\color #faf0e6
+\end_branch
+\branch proofs
+\selected 1
+\color #faf0e6
+\end_branch
+\branch answers
+\selected 1
+\color #faf0e6
+\end_branch
+\branch solutions
+\selected 1
+\color #faf0e6
+\end_branch
+\leftmargin 1in
+\topmargin 1in
+\rightmargin 1in
+\bottommargin 1in
+\secnumdepth 2
+\tocdepth 1
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 2
+\paperpagestyle headings
+\listings_params "basicstyle={\ttfamily},breaklines=true,language=R"
+\bullet 1 0 9 -1
+\tracking_changes false
+\output_changes false
+\author ""
+\author ""
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+\size largest
+IPSUR.lyx
+\family default
+ - Introduction to Probability and Statistics Using
+\family sans
+R
+\end_layout
+
+\begin_layout Plain Layout
+
+\family typewriter
+\size small
+Copyright (C) 2010 G.
+ Jay Kerns, <gkerns at ysu.edu>
+\end_layout
+
+\begin_layout Plain Layout
+
+\family typewriter
+\size small
+This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or (at your
+ option) any later version.
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program.
+ If not, see <http://www.gnu.org/licenses/>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% IPSUR.Rnw - Introduction to Probability and Statistics Using R %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% Copyright (C) 2010 G.
+ Jay Kerns, <gkerns at ysu.edu> %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% This program is free software: you can redistribute it and/or %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% modify it under the terms of the GNU General Public License as %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% published by the Free Software Foundation, either version 3 %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% of the License, or (at your option) any later version.
+ This %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% program is distributed in the hope that it will be useful, %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% See the GNU General Public License for more details.
+ You %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% should have received a copy of the GNU General Public License %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% along with this program.
+ If not, see %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% <http://www.gnu.org/licenses/> %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%% %%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end_layout
+
+\begin_layout Plain Layout
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Scrap
+<<echo = FALSE>>=
+\begin_inset Newline newline
+\end_inset
+
+### IPSUR.R - Introduction to Probability and Statistics Using R
+\begin_inset Newline newline
+\end_inset
+
+### Copyright (C) 2010 G.
+ Jay Kerns, <gkerns at ysu.edu>
+\begin_inset Newline newline
+\end_inset
+
+### This program is free software: you can redistribute it and/or modify
+\begin_inset Newline newline
+\end_inset
+
+### it under the terms of the GNU General Public License as published by
+\begin_inset Newline newline
+\end_inset
+
+### the Free Software Foundation, either version 3 of the License, or
+\begin_inset Newline newline
+\end_inset
+
+### (at your option) any later version.
+\begin_inset Newline newline
+\end_inset
+
+### This program is distributed in the hope that it will be useful,
+\begin_inset Newline newline
+\end_inset
+
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+\begin_inset Newline newline
+\end_inset
+
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the
+\begin_inset Newline newline
+\end_inset
+
+### GNU General Public License for more details.
+\begin_inset Newline newline
+\end_inset
+
+### You should have received a copy of the GNU General Public License
+\begin_inset Newline newline
+\end_inset
+
+### along with this program.
+ If not, see <http://www.gnu.org/licenses/>
+\begin_inset Newline newline
+\end_inset
+
+###################################################
+\begin_inset Newline newline
+\end_inset
+
+@
+\end_layout
+
+\begin_layout Scrap
+<<echo = FALSE>>=
+\begin_inset Newline newline
+\end_inset
+
+seed <- 42
+\begin_inset Newline newline
+\end_inset
+
+set.seed(seed)
+\begin_inset Newline newline
+\end_inset
+
+options(width = 70)
+\begin_inset Newline newline
+\end_inset
+
+#library(random)
+\begin_inset Newline newline
+\end_inset
+
+#i_seed <- randomNumbers(n = 624, col = 1, min = -1e+09, max = 1e+09)
+\begin_inset Newline newline
+\end_inset
+
+#.Random.seed[2:626] <- as.integer(c(1, i_seed))
+\begin_inset Newline newline
+\end_inset
+
+#save.image(file = "seed.RData")
+\begin_inset Newline newline
+\end_inset
+
+@
+\end_layout
+
+\begin_layout Scrap
+<<echo = FALSE>>=
+\begin_inset Newline newline
+\end_inset
+
+options(useFancyQuotes = FALSE)
+\begin_inset Newline newline
+\end_inset
+
+#library(prob)
+\begin_inset Newline newline
+\end_inset
+
+library(RcmdrPlugin.IPSUR)
+\begin_inset Newline newline
+\end_inset
+
+# Generate RcmdrTestDrive
+\begin_inset Newline newline
+\end_inset
+
+n <- 168
+\begin_inset Newline newline
+\end_inset
+
+# generate order
+\begin_inset Newline newline
+\end_inset
+
+order <- 1:n
+\begin_inset Newline newline
+\end_inset
+
+# generate race
+\begin_inset Newline newline
+\end_inset
+
+race <- sample(c("White","AfAmer","Asian","Other"), size=n, prob=c(76,13,5,6),
+ replace = TRUE)
+\begin_inset Newline newline
+\end_inset
+
+race <- factor(race)
+\begin_inset Newline newline
+\end_inset
+
+# generate gender and smoke
+\begin_inset Newline newline
+\end_inset
+
+tmp <- sample(4, size=n, prob=c(12,38,9,41), replace = TRUE)
+\begin_inset Newline newline
+\end_inset
+
+gender <- factor(ifelse(tmp < 3,"Male", "Female"))
+\begin_inset Newline newline
+\end_inset
+
+smoke <- factor(ifelse(tmp %in% c(1,3), "Yes", "No"))
+\begin_inset Newline newline
+\end_inset
+
+# generate parking
+\begin_inset Newline newline
+\end_inset
+
+parking <- rgeom(n, prob = 0.4) + 1
+\begin_inset Newline newline
+\end_inset
+
+# generate salary
+\begin_inset Newline newline
+\end_inset
+
+m <- 17 + (as.numeric(gender)-1)
+\begin_inset Newline newline
+\end_inset
+
+s <- 1 + (2 - as.numeric(gender))
+\begin_inset Newline newline
+\end_inset
+
+salary <- rnorm(n, mean = m, sd = s)
+\begin_inset Newline newline
+\end_inset
+
+# simulate reduction
+\begin_inset Newline newline
+\end_inset
+
+x <- arima.sim(list(order=c(1,0,0), ar=.9), n=n)
+\begin_inset Newline newline
+\end_inset
+
+reduction <- as.numeric((20*x + order)/n + 5)
+\begin_inset Newline newline
+\end_inset
+
+# simulate before and after
+\begin_inset Newline newline
+\end_inset
+
+before <- rlogis(n, location = 68, scale = 3)
+\begin_inset Newline newline
+\end_inset
+
+m <- (as.numeric(smoke)-1)*2.5
+\begin_inset Newline newline
+\end_inset
+
+after <- before - rnorm(n, mean = m, sd=0.1)
+\begin_inset Newline newline
+\end_inset
+
+RcmdrTestDrive <- data.frame(order = order, race = race, smoke = smoke, gender
+ = gender, salary = salary, reduction = reduction, before = before, after
+ = after, parking = parking)
+\begin_inset Newline newline
+\end_inset
+
+# clean up
+\begin_inset Newline newline
+\end_inset
+
+remove(list = names(RcmdrTestDrive))
+\begin_inset Newline newline
+\end_inset
+
+remove(x, n, m, s, tmp)
+\begin_inset Newline newline
+\end_inset
+
+@
+\end_layout
+
+\begin_layout Scrap
+<<echo = FALSE>>=
+\begin_inset Newline newline
+\end_inset
+
+plot.htest <- function (x, hypoth.or.conf = 'Hypoth',...) {
+\begin_inset Newline newline
+\end_inset
+
+require(HH)
+\begin_inset Newline newline
+\end_inset
+
+if (x$method == "1-sample proportions test with continuity correction" ||
+ x$method == "1-sample proportions test without continuity correction"){
+\begin_inset Newline newline
+\end_inset
+
+mu <- x$null.value
+\begin_inset Newline newline
+\end_inset
+
+obs.mean <- x$estimate
+\begin_inset Newline newline
+\end_inset
+
+n <- NA
+\begin_inset Newline newline
+\end_inset
+
+std.dev <- abs(obs.mean - mu)/sqrt(x$statistic)
+\begin_inset Newline newline
+\end_inset
+
+deg.freedom <- NA
+\begin_inset Newline newline
+\end_inset
+
+if(x$alternative == "two.sided"){
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- (1 - attr(x$conf.int, "conf.level"))/2
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$alternative == "less") {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+} else {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+}
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$method == "One Sample z-test"){
+\begin_inset Newline newline
+\end_inset
+
+mu <- x$null.value
+\begin_inset Newline newline
+\end_inset
+
+obs.mean <- x$estimate
+\begin_inset Newline newline
+\end_inset
+
+n <- x$parameter[1]
+\begin_inset Newline newline
+\end_inset
+
+std.dev <- x$parameter[2]
+\begin_inset Newline newline
+\end_inset
+
+deg.freedom <- NA
+\begin_inset Newline newline
+\end_inset
+
+if(x$alternative == "two.sided"){
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- (1 - attr(x$conf.int, "conf.level"))/2
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$alternative == "less") {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+} else {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+}
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$method == "One Sample t-test" || x$method == "Paired t-test"){
+\begin_inset Newline newline
+\end_inset
+
+mu <- x$null.value
+\begin_inset Newline newline
+\end_inset
+
+obs.mean <- x$estimate
+\begin_inset Newline newline
+\end_inset
+
+n <- x$parameter + 1
+\begin_inset Newline newline
+\end_inset
+
+std.dev <- x$estimate/x$statistic*sqrt(n)
+\begin_inset Newline newline
+\end_inset
+
+deg.freedom <- x$parameter
+\begin_inset Newline newline
+\end_inset
+
+if(x$alternative == "two.sided"){
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- (1 - attr(x$conf.int, "conf.level"))/2
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$alternative == "less") {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+} else {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+}
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$method == "Welch Two Sample t-test"){
+\begin_inset Newline newline
+\end_inset
+
+mu <- x$null.value
+\begin_inset Newline newline
+\end_inset
+
+obs.mean <- -diff(x$estimate)
+\begin_inset Newline newline
+\end_inset
+
+n <- x$parameter + 2
+\begin_inset Newline newline
+\end_inset
+
+std.dev <- obs.mean/x$statistic*sqrt(n)
+\begin_inset Newline newline
+\end_inset
+
+deg.freedom <- x$parameter
+\begin_inset Newline newline
+\end_inset
+
+if(x$alternative == "two.sided"){
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- (1 - attr(x$conf.int, "conf.level"))/2
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$alternative == "less") {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+} else {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+}
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$method == " Two Sample t-test"){
+\begin_inset Newline newline
+\end_inset
+
+mu <- x$null.value
+\begin_inset Newline newline
+\end_inset
+
+obs.mean <- -diff(x$estimate)
+\begin_inset Newline newline
+\end_inset
+
+n <- x$parameter + 2
+\begin_inset Newline newline
+\end_inset
+
+std.dev <- obs.mean/x$statistic*sqrt(n)
+\begin_inset Newline newline
+\end_inset
+
+deg.freedom <- x$parameter
+\begin_inset Newline newline
+\end_inset
+
+if(x$alternative == "two.sided"){
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- (1 - attr(x$conf.int, "conf.level"))/2
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+} else if (x$alternative == "less") {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+} else {
+\begin_inset Newline newline
+\end_inset
+
+alpha.right <- 1 - attr(x$conf.int, "conf.level")
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.left <- FALSE
+\begin_inset Newline newline
+\end_inset
+
+Use.alpha.right <- TRUE
+\begin_inset Newline newline
+\end_inset
+
+}
+\begin_inset Newline newline
+\end_inset
+
+}
+\begin_inset Newline newline
+\end_inset
+
+return(normal.and.t.dist(mu.H0 = mu, obs.mean = obs.mean, std.dev = std.dev, n =
+ n, deg.freedom = deg.freedom, alpha.right = alpha.right, Use.obs.mean = TRUE,
+ Use.alpha.left = Use.alpha.left, Use.alpha.right = Use.alpha.right, hypoth.or.conf
+ = hypoth.or.conf))
+\begin_inset Newline newline
+\end_inset
+
+}
+\begin_inset Newline newline
+\end_inset
+
+@
+\end_layout
+
+\begin_layout Title
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+fontsize{30}{35}
+\backslash
+selectfont
+\end_layout
+
+\end_inset
+
+Introduction to Probability
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+
+\backslash
+
+\end_layout
+
+\end_inset
+
+and Statistics Using
+\family sans
+R
+\end_layout
+
+\begin_layout Date
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+fontsize{24}{28}
+\backslash
+selectfont
+\end_layout
+
+\end_inset
+
+
+\noun on
+First Edition
+\end_layout
+
+\begin_layout Author
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+fontsize{24}{28}
+\backslash
+selectfont
+\end_layout
+
+\end_inset
+
+G.
+\begin_inset space ~
+\end_inset
+
+Jay Kerns
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+pagenumbering{roman}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+setcounter{page}{2}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\noindent
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+IPSUR
+\end_layout
+
+\end_inset
+
+: Introduction to Probability and Statistics Using
+\family sans
+R
+\end_layout
+
+\begin_layout Standard
+\noindent
+Copyright
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+textcopyright
+\end_layout
+
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+2010 G.
+\begin_inset space ~
+\end_inset
+
+Jay Kerns
+\end_layout
+
+\begin_layout Standard
+\noindent
+ISBN: 978-0-557-24979-4
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace defskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\noindent
+Permission is granted to copy, distribute and/or modify this document under
+ the terms of the GNU Free Documentation License, Version 1.3 or any later
+ version published by the Free Software Foundation; with no Invariant Sections,
+ no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled ``GNU Free Documentat
+ion License''.
+
+\begin_inset VSpace vfill
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+cleardoublepage
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+phantomsection
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+pdfbookmark[1]{Contents}{table}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset toc
+LatexCommand tableofcontents
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+cleardoublepage
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+phantomsection
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+addcontentsline{toc}{chapter}{Preface}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Chapter*
+Preface
+\end_layout
+
+\begin_layout Standard
+This book was expanded from lecture materials I use in a one semester upper-divi
+sion undergraduate course entitled
+\emph on
+Probability and Statistics
+\emph default
+ at Youngstown State University.
+ Those lecture materials, in turn, were based on notes that I transcribed
+ as a graduate student at Bowling Green State University.
+ The course for which the materials were written is 50-50 Probability and
+ Statistics, and the attendees include mathematics, engineering, and computer
+ science majors (among others).
+ The catalog prerequisites for the course are a full year of calculus.
+\end_layout
+
+\begin_layout Standard
+The book can be subdivided into three basic parts.
+ The first part includes the introductions and elementary
+\emph on
+descriptive statistics
+\emph default
+; I want the students to be knee-deep in data right out of the gate.
+ The second part is the study of
+\emph on
+probability
+\emph default
+, which begins at the basics of sets and the equally likely model, journeys
+ past discrete/continuous random variables and continues through to multivariate
+ distributions.
+ The chapter on sampling distributions paves the way to the third part,
+ which is
+\emph on
+inferential statistics
+\emph default
+.
+ This last part includes point and interval estimation, hypothesis testing,
+ and finishes with introductions to selected topics in applied statistics.
+\end_layout
+
+\begin_layout Standard
+I usually only have time in one semester to cover a small subset of this
+ book.
+ I cover the material in Chapter 2 in a class period that is supplemented
+ by a take-home assignment for the students.
+ I spend a lot of time on Data Description, Probability, Discrete, and Continuou
+s Distributions.
+ I mention selected facts from Multivariate Distributions in passing, and
+ discuss the meaty parts of Sampling Distributions before moving right along
+ to Estimation (which is another one I dwell on considerably).
+ Hypothesis Testing goes faster after all of the previous work, and by that
+ time the end of the semester is in sight.
+ I normally choose one or two final chapters (sometimes three) from the
+ remaining to survey, and regret at the end that I did not have the chance
+ to cover more.
+\end_layout
+
+\begin_layout Standard
+In an attempt to be correct I have included material in this book which
+ I would normally not mention during the course of a standard lecture.
+ For instance, I normally do not highlight the intricacies of measure theory
+ or integrability conditions when speaking to the class.
+ Moreover, I often stray from the matrix approach to multiple linear regression
+ bacause many of my students have not yet been formally trained in linear
+ algebra.
+ That being said, it is important to me for the students to hold something
+ in their hands which acknowledges the world of mathematics and statistics
+ beyond the classroom, and which may be useful to them for many semesters
+ to come.
+ It also mirrors my own experience as a student.
+\end_layout
+
+\begin_layout Standard
+This document's ultimate goal is to be a more or less self contained, essentiall
+y complete, correct, introductory textbook.
+ There should be plenty of exercises for the student, with full solutions
+ for some and no solutions for others (so that the instructor may assign
+ them for grading).
+ By
+\begin_inset listings
+lstparams "showstringspaces=false"
+inline true
+status open
+
+\begin_layout Scrap
+
+Sweave
+\end_layout
+
+\end_inset
+
+'s dynamic nature it is possible to write randomly generated exercises and
+ I had planned to implement this idea already throughout the book.
+ Alas, there are only 24 hours in a day.
+ Look for more in future editions.
+\end_layout
+
+\begin_layout Standard
+Seasoned readers will be able to detect my origins:
+\emph on
+Probability and Statistical Inference
+\emph default
+ by Hogg and Tanis
+\begin_inset CommandInset citation
+LatexCommand citet
+key "Hogg2006"
+
+\end_inset
+
+,
+\emph on
+Statistical Inference
+\emph default
+ by Casella and Berger
+\begin_inset CommandInset citation
+LatexCommand citet
+key "Casella2002"
+
+\end_inset
+
+, and
+\emph on
+Theory of Point Estimation/Testing Statistical Hypotheses
+\emph default
+ by Lehmann
+\begin_inset CommandInset citation
+LatexCommand cite
+key "Lehmann1998,Lehmann1986"
+
+\end_inset
+
+.
+ I highly recommend each of those books to every reader of this one.
+ Some
+\family sans
+R
+\family default
+ books with
+\begin_inset Quotes eld
+\end_inset
+
+introductory
+\begin_inset Quotes erd
+\end_inset
+
+ in the title that I recommend are
+\emph on
+Introductory Statistics with
+\family sans
+R
+\family default
+\emph default
+ by Dalgaard
+\begin_inset CommandInset citation
+LatexCommand cite
+key "Dalgaard2008"
+
+\end_inset
+
+ and
+\emph on
+Using
+\family sans
+R
+\family default
+ for Introductory Statistics
+\emph default
+ by Verzani
+\begin_inset CommandInset citation
+LatexCommand cite
+key "Verzani2005"
+
+\end_inset
+
+.
+ Surely there are many, many other good introductory books about
+\family sans
+R
+\family default
+, but frankly, I have tried to steer clear of them for the past year or
+ so to avoid any undue influence on my own writing.
+\end_layout
+
+\begin_layout Standard
+I would like to make special mention of two other books:
+\emph on
+Introduction to Statistical Thought
+\emph default
+ by Michael Lavine
+\begin_inset CommandInset citation
+LatexCommand cite
+key "Lavine2009"
+
+\end_inset
+
+ and
+\emph on
+Introduction to Probability
+\emph default
+ by Grinstead and Snell
+\begin_inset CommandInset citation
+LatexCommand cite
+key "Grinstead1997"
+
+\end_inset
+
+.
+ Both of these books are
+\emph on
+free
+\emph default
+ and are what ultimately convinced me to release
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+IPSUR
+\backslash
+
+\end_layout
+
+\end_inset
+
+ under a free license, too.
+\end_layout
+
+\begin_layout Standard
+Please bear in mind that the title of this book is
+\begin_inset Quotes eld
+\end_inset
+
+Introduction to Probability and Statistics Using
+\family sans
+R
+\family default
+
+\begin_inset Quotes erd
+\end_inset
+
+, and not
+\begin_inset Quotes eld
+\end_inset
+
+Introduction to
+\family sans
+R
+\family default
+ Using Probability and Statistics
+\begin_inset Quotes erd
+\end_inset
+
+, nor even
+\begin_inset Quotes eld
+\end_inset
+
+Introduction to Probability and Statistics and
+\family sans
+R
+\family default
+ Using Words
+\begin_inset Quotes erd
+\end_inset
+
+.
+ The people at the party are probability and statistics; the handshake is
+
+\family sans
+R
+\family default
+.
+ There are several important topics about
+\family sans
+R
+\family default
+ which some individuals will feel are underdeveloped, glossed over, or wantonly
+ omitted.
+ Some will feel the same way about the probabilistic and/or statistical
+ content.
+ Still others will just want to learn
+\family sans
+R
+\family default
+ and skip all of the mathematics.
+\end_layout
+
+\begin_layout Standard
+Despite any misgivings: here it is, warts and all.
+ I humbly invite said individuals to take this book, with the GNU-FDL in
+ hand, and make it better.
+ In that spirit there are at least a few ways in my view in which this book
+ could be improved.
+\end_layout
+
+\begin_layout Description
+Better
+\begin_inset space ~
+\end_inset
+
+data: the data analyzed in this book are almost entirely from the
+\begin_inset listings
+lstparams "showstringspaces=false"
+inline true
+status open
+
+\begin_layout Scrap
+
+datasets
+\end_layout
+
+\end_inset
+
+ package in base
+\family sans
+R
+\family default
+, and here is why:
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+I made a conscious effort to minimize dependence on contributed packages,
+\end_layout
+
+\begin_layout Enumerate
+The data are instantly available, already in the correct format, so we need
+ not take time to manage them, and
+\end_layout
+
+\begin_layout Enumerate
+The data are
+\emph on
+real
+\emph default
+.
+\end_layout
+
+\begin_layout Standard
+I made no attempt to choose data sets that would be interesting to the students;
+ rather, data were chosen for their potential to convey a statistical point.
+ Many of the datasets are decades old or more (for instance, the data used
+ to introduce simple linear regression are the speeds and stopping distances
+ of cars in the 1920's).
+\end_layout
+
+\begin_layout Standard
+In a perfect world with infinite time I would research and contribute recent,
+
+\emph on
+real
+\emph default
+ data in a context crafted to engage the students in
+\emph on
+every
+\emph default
+ example.
+ One day I hope to stumble over said time.
+ In the meantime, I will add new data sets incrementally as time permits.
+\end_layout
+
+\end_deeper
+\begin_layout Description
+More
+\begin_inset space ~
+\end_inset
+
+proofs: for the sake of completeness (I understand that some people would
+ not consider more proofs to be improvement).
+ Many proofs have been skipped entirely, and am not aware of any rhyme or
+ reason to the current omissions.
+ I will add more when I get a chance.
+
+\end_layout
+
+\begin_layout Description
+More
+\begin_inset space ~
+\end_inset
+
+and
+\begin_inset space ~
+\end_inset
+
+better
+\begin_inset space ~
+\end_inset
+
+graphics: I have not used the
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},breaklines=true,language=R"
+inline true
+status open
+
+\begin_layout Scrap
+
+ggplot2
+\end_layout
+
+\end_inset
+
+ package
+\begin_inset CommandInset citation
+LatexCommand citet
+key "Wickam2009"
+
+\end_inset
+
+ because I do not know how to use it yet.
+ It is on my to-do list.
+\end_layout
+
+\begin_layout Description
+More
+\begin_inset space ~
+\end_inset
+
+and
+\begin_inset space ~
+\end_inset
+
+better
+\begin_inset space ~
+\end_inset
+
+exercises: There are only a few exercises in the first edition simply because
+ I have not had time to write more.
+ I have toyed with the
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},breaklines=true,language=R"
+inline true
+status open
+
+\begin_layout Scrap
+
+exams
+\end_layout
+
+\end_inset
+
+ package
+\begin_inset CommandInset citation
+LatexCommand citet
+key "exams"
+
+\end_inset
+
+ and I believe that it is a right way to move forward.
+ As I learn more about what the package can do I would like to incorporate
+ it into later editions of this book.
+\end_layout
+
+\begin_layout Section*
+About This Document
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+IPSUR
+\backslash
+
+\end_layout
+
+\end_inset
+
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/ipsur -r 141
More information about the IPSUR-commits
mailing list