[IPSUR-commits] r186 - pkg/IPSUR pkg/IPSUR/inst/doc www/book www/book/download

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 9 05:37:47 CEST 2010


Author: gkerns
Date: 2010-10-09 05:37:46 +0200 (Sat, 09 Oct 2010)
New Revision: 186

Modified:
   pkg/IPSUR/DESCRIPTION
   pkg/IPSUR/inst/doc/IPSUR.Rnw
   www/book/download/IPSUR.lyx
   www/book/download/IPSUR.zip
   www/book/topMenu.php
Log:
fixed a dependency issue, updates to the book, and added resources to the webpage


Modified: pkg/IPSUR/DESCRIPTION
===================================================================
--- pkg/IPSUR/DESCRIPTION	2010-09-21 18:25:36 UTC (rev 185)
+++ pkg/IPSUR/DESCRIPTION	2010-10-09 03:37:46 UTC (rev 186)
@@ -5,7 +5,7 @@
 Date: 2010-09-07
 Author: G. Jay Kerns
 Maintainer: G. Jay Kerns <gkerns at ysu.edu>
-Suggests: actuar, aplpack, coin, DAAG, diagram, distr, distrEx, distrTeach, e1071, exactRankTests, HH (>= 2.1-32), Hmisc, lattice, lmtest, mvtnorm, odfWeave, prob, qcc, RcmdrPlugin.IPSUR (>= 0.1-6), Rcmdr, reshape, scatterplot3d, TeachingDemos (>= 2.5), vcd
+Suggests: actuar, aplpack, coin, combinat, DAAG, diagram, distr, distrEx, distrTeach, e1071, exactRankTests, HH (>= 2.1-32), Hmisc, lattice, lmtest, mvtnorm, odfWeave, prob, qcc, RcmdrPlugin.IPSUR (>= 0.1-6), Rcmdr, reshape, scatterplot3d, TeachingDemos (>= 2.5), vcd
 Description: This package contains the Sweave source code used to generate IPSUR, an introductory probability and statistics textbook, alongside other supplementary materials such as the parsed R code for the book and data for the examples and exercises.  The book is released under the GNU Free Documentation License.
 License: GPL (>= 3)
 LazyLoad: yes

Modified: pkg/IPSUR/inst/doc/IPSUR.Rnw
===================================================================
--- pkg/IPSUR/inst/doc/IPSUR.Rnw	2010-09-21 18:25:36 UTC (rev 185)
+++ pkg/IPSUR/inst/doc/IPSUR.Rnw	2010-10-09 03:37:46 UTC (rev 186)
@@ -1,4 +1,4 @@
-%% LyX 1.6.5 created this file.  For more info, see http://www.lyx.org/.
+%% LyX 1.6.7 created this file.  For more info, see http://www.lyx.org/.
 %% Do not edit unless you really know what you are doing.
 \documentclass[12pt,english,nogin]{book}
 \usepackage{lmodern}
@@ -32,8 +32,8 @@
  {hyperref}
 \hypersetup{pdftitle={Introduction to Probability and Statistics Using R},
  pdfauthor={G. Jay Kerns},
- linkcolor=blue,  citecolor=black, urlcolor=blue}
- 
+ linkcolor=black,  citecolor=black, urlcolor=black}
+
 \makeatletter
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
@@ -154,11 +154,11 @@
 
 %%  Sweave specific commands
 % make the input blue, output red
-\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{blue}}
-\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{red}}
+%\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{blue}}
+%\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{red}}
 % make the input/output black
-%\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{black}}
-%\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{black}}
+\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{black}}
+\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{black}}
 
 
 % get rid of extra Sweave space
@@ -422,7 +422,7 @@
 
 \tableofcontents{}
 
-\noindent \cleardoublepage
+\cleardoublepage
 \phantomsection
 \addcontentsline{toc}{chapter}{Preface}
 
@@ -739,7 +739,7 @@
 
 \pagenumbering{arabic} 
 
-\noindent \noindent This chapter has proved to be the hardest to write, by far.
+\noindent This chapter has proved to be the hardest to write, by far.
 The trouble is that there is so much to say -- and so many people
 have already said it so much better than I could. When I get something
 I like I will release it here.
@@ -793,9 +793,7 @@
 and \ref{sec:Conditional-Distributions}. I plan to add more bayesian
 material in later editions of this book.
 
-\pagebreak{}
 
-
 \section*{Chapter Exercises}
 
 \addcontentsline{toc}{section}{Chapter Exercises}
@@ -1942,6 +1940,9 @@
 
 \end{example}
 
+\paragraph*{Density estimates}
+
+
 \subsection{Qualitative Data, Categorical Data, and Factors\label{sub:Qualitative-Data}}
 
 Qualitative data are simply any type of data that are not numerical,
@@ -3072,15 +3073,43 @@
 
 \subsection{Bivariate Data\label{sub:Bivariate-Data}}
 \begin{itemize}
+\item Stacked bar charts
+\item odds ratio and relative risk
 \item Introduce the sample correlation coefficient.
+\end{itemize}
+The \textbf{sample Pearson product-moment }\textbf{\emph{correlation
+coefficient}}:\[
+r=\frac{\sum_{i=1}^{n}(x_{i}-\xbar)(y_{i}-\ybar)}{\sqrt{\sum_{i=1}^{n}(x_{i}-\xbar)}\sqrt{\sum_{i=1}^{n}(y_{i}-\ybar)}}\]
+
+\begin{itemize}
+\item independent of scale
+\item $-1<r<1$
+\item measures \emph{strength} and \emph{direction} of linear association
 \item Two-Way Tables. Done with \inputencoding{latin9}\lstinline[showstringspaces=false]!table!\inputencoding{utf8},
 or in the \textsf{R} Commander by following \textsf{Statistics $\triangleright$
 Contingency Tables $\triangleright$} \textsf{Two-way Tables}. You
 can also enter and analyze a two-way table.
+
+\begin{itemize}
+\item table
+\item prop.table
+\item addmargins
+\item rowPercents (Rcmdr)
+\item colPercents (Rcmdr)
+\item totPercents(Rcmdr)
+\item A <- xtabs(\textasciitilde{} gender + race, data = RcmdrTestDrive)
+\item xtabs( Freq \textasciitilde{} Class + Sex, data = Titanic) \# from
+built in table
+\item barplot(A, legend.text=TRUE) 
+\item barplot(t(A), legend.text=TRUE) 
+\item barplot(A, legend.text=TRUE, beside = TRUE)
+\item spineplot(gender \textasciitilde{} race, data = RcmdrTestDrive)
+\item Spine plot: plots categorical versus categorical
+\end{itemize}
 \item Scatterplot: look for linear association and correlation. 
 
 \begin{itemize}
-\item carb \textasciitilde{} optden, data = Formaldehyde
+\item carb \textasciitilde{} optden, data = Formaldehyde (boring)
 \item conc \textasciitilde{} rate, data = Puromycin
 \item xyplot(accel \textasciitilde{} dist, data = attenu) nonlinear association
 \item xyplot(eruptions \textasciitilde{} waiting, data = faithful) (linear,
@@ -3111,10 +3140,8 @@
 \section{Comparing Populations\label{sec:Comparing-Data-Sets}}
 
 Sometimes we have data from two or more groups (or populations) and
-we would like to compare them and draw conclusions. What we should
-imagine is
-
-Some issues that we would like to address:
+we would like to compare them and draw conclusions. Some issues that
+we would like to address:
 \begin{itemize}
 \item Comparing centers and spreads: variation within versus between groups
 \item Comparing clusters and gaps
@@ -3144,11 +3171,14 @@
 medians. See Chapter \ref{cha:Hypothesis-Testing}.
 \end{itemize}
 \item Stripcharts
+
+\begin{itemize}
+\item stripchart(weight \textasciitilde{} feed, method=\textquotedbl{}stack\textquotedbl{},
+data=chickwts)
+\end{itemize}
 \item Bar Graphs
 
 \begin{itemize}
-\item plot(xtabs(Freq \textasciitilde{} Admit + Gender, data = UCBAdmissions))
-\# rescaled barplot
 \item barplot(xtabs(Freq \textasciitilde{} Admit + Gender, data = UCBAdmissions))
 \# stacked bar chart
 \item barplot(xtabs(Freq \textasciitilde{} Admit, data = UCBAdmissions))
@@ -3227,6 +3257,12 @@
 (or just mosaic(Titanic))
 \item mosaic(\textasciitilde{} Admit + Dept + Gender, data = UCBAdmissions)
 \end{itemize}
+\item Spine plots
+
+\begin{itemize}
+\item spineplot(xtabs(Freq \textasciitilde{} Admit + Gender, data = UCBAdmissions))
+\# rescaled barplot
+\end{itemize}
 \item Quantile-quantile plots: There are two ways to do this. One way is
 to compare two independent samples (of the same size). qqplot(x,y).
 Another way is to compare the sample quantiles of one variable to
@@ -3803,12 +3839,32 @@
 \item Bayes' Rule and how it relates to the subjective view of probability
 \item what we mean by 'random variables', and where they come from
 \end{itemize}
+%
+\begin{figure}
+\begin{centering}
+<<echo = FALSE, fig = TRUE, width = 4.5, height = 2.75>>=
+require(diagram)
+par(mex = 0.2, cex = 0.5)
+openplotmat(frame.plot=TRUE)
+straightarrow(from = c(0.46,0.74), to = c(0.53,0.71), arr.pos = 1)
+straightarrow(from = c(0.3,0.65), to = c(0.3,0.51), arr.pos = 1)
+textellipse(mid = c(0.74,0.55), box.col = grey(0.95), radx = 0.24, rady = 0.22, lab = c(expression(bold(underline(DETERMINISTIC))), expression(2*H[2]+O[2] %->% H[2]*O), "3 + 4 = 7"), cex = 2 )
+textrect(mid = c(0.3, 0.75), radx = 0.15, rady = 0.1, lab = c("Experiments"), cex = 2 )
+textellipse(mid = c(0.29,0.25), box.col = grey(0.95), radx = 0.27, rady = 0.22, lab = c(expression(bold(underline(RANDOM))), "toss coin, roll die", "count ants on sidewalk", "measure rainfall" ), cex = 2 )
+@
+\par\end{centering}
 
+\caption{Two types of experiments}
+
+\end{figure}
+
+
+
 \section{Sample Spaces\label{sec:Sample-Spaces}}
 
 For a random experiment $E$, the set of all possible outcomes of
 $E$ is called the \emph{sample space\index{sample space}} and is
-denoted by the letter $S$. For the coin-toss experiment, $S$ would
+denoted by the letter $S$. For a coin-toss experiment, $S$ would
 be the results {}``Head'' and {}``Tail'', which we may represent
 by $S=\left\{ H,T\right\} $. Formally, the performance of a random
 experiment is the unpredictable selection of an outcome in $S$.
@@ -6271,14 +6327,14 @@
 \subsection{Mean, Variance, and Standard Deviation\label{sub:mean-variance-sd}}
 
 There are numbers associated with PMFs. One important example is the
-mean $\mu$, also known as $\E X$:\begin{equation}
+mean $\mu$, also known as $\E X$ (which we will discuss later):\begin{equation}
 \mu=\E X=\sum_{x\in S}xf_{X}(x),\end{equation}
 provided the (potentially infinite) series $\sum|x|f_{X}(x)$ is convergent.
 Another important number is the variance:\begin{equation}
-\sigma^{2}=\E(X-\mu)^{2}=\sum_{x\in S}(x-\mu)^{2}f_{X}(x),\end{equation}
+\sigma^{2}=\sum_{x\in S}(x-\mu)^{2}f_{X}(x),\end{equation}
 which can be computed (see Exercise \ref{xca:variance-shortcut})
-with the alternate formula $\sigma^{2}=\E X^{2}-(\E X)^{2}$. Directly
-defined from the variance is the standard deviation $\sigma=\sqrt{\sigma^{2}}$. 
+with the alternate formula $\sigma^{2}=\sum x{}^{2}f_{X}(x)-\mu^{2}$.
+Directly defined from the variance is the standard deviation $\sigma=\sqrt{\sigma^{2}}$. 
 \begin{example}
 \label{exa:disc-pmf-mean}We will calculate the mean of $X$ in Example
 \ref{exa:Toss-a-coin}.\[
@@ -6398,9 +6454,9 @@
 is, if we repeatedly choose integers at random from 1 to $m$ then,
 on the average, we expect to get $(m+1)/2$. To get the variance we
 first calculate\[
-\E X^{2}=\frac{1}{m}\sum_{x=1}^{m}x^{2}=\frac{1}{m}\frac{m(m+1)(2m+3)}{6}=\frac{(m+1)(2m+1)}{6},\]
+\sum_{x=1}^{m}x^{2}f_{X}(x)=\frac{1}{m}\sum_{x=1}^{m}x^{2}=\frac{1}{m}\frac{m(m+1)(2m+1)}{6}=\frac{(m+1)(2m+1)}{6},\]
  and finally,\begin{equation}
-\sigma^{2}=\E X^{2}-(\E X)^{2}=\frac{(m+1)(2m+1)}{6}-\left(\frac{m+1}{2}\right)^{2}=\cdots=\frac{m^{2}-1}{12}.\end{equation}
+\sigma^{2}=\sum_{x=1}^{m}x^{2}f_{X}(x)-\mu^{2}=\frac{(m+1)(2m+1)}{6}-\left(\frac{m+1}{2}\right)^{2}=\cdots=\frac{m^{2}-1}{12}.\end{equation}
 
 \begin{example}
 Roll a die and let $X$ be the upward face showing. Then $m=6$, $\mu=7/2=3.5$,
@@ -8031,6 +8087,8 @@
 Z=\frac{X-\mu}{\sigma}\sim\mathsf{norm}(\mathtt{mean}=0,\,\mathtt{sd}=1).\end{equation}
 
 \end{prop}
+
+
 The MGF of $Z\sim\mathsf{norm}(\mathtt{mean}=0,\,\mathtt{sd}=1)$
 is relatively easy to derive:\begin{eqnarray*}
 M_{Z}(t) & = & \int_{-\infty}^{\infty}\me^{tz}\frac{1}{\sqrt{2\pi}}\me^{-z^{2}/2}\diff z,\\
@@ -8050,7 +8108,9 @@
 M_{X}(t)=\E\me^{tX}=\E\me^{t(\sigma Z+\mu)}=\E\me^{\sigma tX}\me^{\mu}=\me^{t\mu}M_{Z}(\sigma t),\]
 and we know that $M_{Z}(t)=\me^{t^{2}/2}$, thus substituting we get\[
 M_{X}(t)=\me^{t\mu}\me^{(\sigma t)^{2}/2}=\exp\left\{ \mu t+\sigma^{2}t^{2}/2\right\} ,\]
-for $-\infty<t<\infty$.\end{example}
+for $-\infty<t<\infty$.
+\end{example}
+
 \begin{fact}
 The same argument above shows that if $X$ has MGF $M_{X}(t)$ then
 the MGF of $Y=a+bX$ is \begin{equation}
@@ -15653,7 +15713,20 @@
 \url{http://cran.r-project.org/doc/contrib/Fox-Companion/appendix.html}
 \par\end{center}
 
+Here is an example of how it works, based on a question from R-help.
 
+<<>>=
+# fake data 
+set.seed(1) 
+x <- seq(from = 0, to = 1000, length.out = 200) 
+y <- 1 + 2*(sin((2*pi*x/360) - 3))^2 + rnorm(200, sd = 2)
+plot(x, y)
+acc.nls <- nls(y ~ a + b*(sin((2*pi*x/360) - c))^2, start = list(a = 0.9, b = 2.3, c = 2.9))
+summary(acc.nls)
+#plot(x, fitted(acc.nls))
+@
+
+
 \subsection{Multicollinearity\label{sub:Multicollinearity}}
 
 A multiple regression model exhibits \emph{multicollinearity} when
@@ -16891,7 +16964,7 @@
 \vfill{}
 
 
-\noindent 
+
 \chapter{Data\label{cha:data}}
 
 This appendix is a reference of sorts regarding some of the data structures

Modified: www/book/download/IPSUR.lyx
===================================================================
--- www/book/download/IPSUR.lyx	2010-09-21 18:25:36 UTC (rev 185)
+++ www/book/download/IPSUR.lyx	2010-10-09 03:37:46 UTC (rev 186)
@@ -1,4 +1,4 @@
-#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -64,11 +64,11 @@
 
 %%  Sweave specific commands
 % make the input blue, output red
-%\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{blue}}
-%\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{red}}
+\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{blue}}
+\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{red}}
 % make the input/output black
-\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{black}}
-\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{black}}
+%\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{black}}
+%\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl, formatcom=\color{black}}
 
 
 % get rid of extra Sweave space
@@ -127,7 +127,7 @@
 \pdf_colorlinks true
 \pdf_backref page
 \pdf_pdfusetitle true
-\pdf_quoted_options "linkcolor=black,  citecolor=black, urlcolor=black"
+\pdf_quoted_options "linkcolor=blue,  citecolor=black, urlcolor=blue"
 \papersize a4paper
 \use_geometry true
 \use_amsmath 1
@@ -1222,11 +1222,6 @@
 \end_layout
 
 \begin_layout Standard
-\noindent
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \begin_inset ERT
 status open
 
@@ -2338,7 +2333,7 @@
 worldwide
 \emph default
  within hours.
- We aren't in Kansas anymore, Dorothy.
+ We aren't in Kansas anymore, Toto.
 \end_layout
 
 \begin_layout Subsection*
@@ -2771,11 +2766,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Chapter
 An Introduction to Probability and Statistics
 \end_layout
@@ -2798,11 +2788,6 @@
 
 \begin_layout Standard
 \noindent
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
-\noindent
 This chapter has proved to be the hardest to write, by far.
  The trouble is that there is so much to say -- and so many people have
  already said it so much better than I could.
@@ -2897,18 +2882,6 @@
  I plan to add more bayesian material in later editions of this book.
 \end_layout
 
-\begin_layout Standard
-\begin_inset Newpage pagebreak
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -2949,10 +2922,6 @@
 
 \end_layout
 
-\begin_layout Standard
-\begin_inset Branch main
-status open
-
 \begin_layout Section
 Downloading and Installing 
 \family sans
@@ -8298,11 +8267,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -8342,10 +8306,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 In this chapter we introduce the different types of data that a statistician
  is likely to encounter, and in each subsection we give some examples of
@@ -10238,6 +10198,10 @@
 \end_layout
 
 \end_deeper
+\begin_layout Paragraph*
+Density estimates
+\end_layout
+
 \begin_layout Subsection
 Qualitative Data, Categorical Data, and Factors
 \begin_inset CommandInset label
@@ -16069,10 +16033,58 @@
 \end_layout
 
 \begin_layout Itemize
+Stacked bar charts
+\end_layout
+
+\begin_layout Itemize
+odds ratio and relative risk
+\end_layout
+
+\begin_layout Itemize
 Introduce the sample correlation coefficient.
 \end_layout
 
+\begin_layout Standard
+The 
+\series bold
+sample Pearson product-moment 
+\emph on
+correlation coefficient
+\series default
+\emph default
+:
+\begin_inset Formula \[
+r=\frac{\sum_{i=1}^{n}(x_{i}-\xbar)(y_{i}-\ybar)}{\sqrt{\sum_{i=1}^{n}(x_{i}-\xbar)}\sqrt{\sum_{i=1}^{n}(y_{i}-\ybar)}}\]
+
+\end_inset
+
+
+\end_layout
+
 \begin_layout Itemize
+independent of scale
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Formula $-1<r<1$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+measures 
+\emph on
+strength
+\emph default
+ and 
+\emph on
+direction
+\emph default
+ of linear association
+\end_layout
+
+\begin_layout Itemize
 Two-Way Tables.
  Done with 
 \color none
@@ -16115,14 +16127,68 @@
  You can also enter and analyze a two-way table.
 \end_layout
 
+\begin_deeper
 \begin_layout Itemize
+table
+\end_layout
+
+\begin_layout Itemize
+prop.table
+\end_layout
+
+\begin_layout Itemize
+addmargins
+\end_layout
+
+\begin_layout Itemize
+rowPercents (Rcmdr)
+\end_layout
+
+\begin_layout Itemize
+colPercents (Rcmdr)
+\end_layout
+
+\begin_layout Itemize
+totPercents(Rcmdr)
+\end_layout
+
+\begin_layout Itemize
+A <- xtabs(~ gender + race, data = RcmdrTestDrive)
+\end_layout
+
+\begin_layout Itemize
+xtabs( Freq ~ Class + Sex, data = Titanic) # from built in table
+\end_layout
+
+\begin_layout Itemize
+barplot(A, legend.text=TRUE) 
+\end_layout
+
+\begin_layout Itemize
+barplot(t(A), legend.text=TRUE) 
+\end_layout
+
+\begin_layout Itemize
+barplot(A, legend.text=TRUE, beside = TRUE)
+\end_layout
+
+\begin_layout Itemize
+spineplot(gender ~ race, data = RcmdrTestDrive)
+\end_layout
+
+\begin_layout Itemize
+Spine plot: plots categorical versus categorical
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
 Scatterplot: look for linear association and correlation.
  
 \end_layout
 
 \begin_deeper
 \begin_layout Itemize
-carb ~ optden, data = Formaldehyde
+carb ~ optden, data = Formaldehyde (boring)
 \end_layout
 
 \begin_layout Itemize
@@ -16289,13 +16355,9 @@
 \begin_layout Standard
 Sometimes we have data from two or more groups (or populations) and we would
  like to compare them and draw conclusions.
- What we should imagine is
+ Some issues that we would like to address:
 \end_layout
 
-\begin_layout Standard
-Some issues that we would like to address:
-\end_layout
-
 \begin_layout Itemize
 Comparing centers and spreads: variation within versus between groups
 \end_layout
@@ -16419,15 +16481,17 @@
 Stripcharts
 \end_layout
 
+\begin_deeper
 \begin_layout Itemize
-Bar Graphs
+stripchart(weight ~ feed, method="stack", data=chickwts)
 \end_layout
 
-\begin_deeper
+\end_deeper
 \begin_layout Itemize
-plot(xtabs(Freq ~ Admit + Gender, data = UCBAdmissions)) # rescaled barplot
+Bar Graphs
 \end_layout
 
+\begin_deeper
 \begin_layout Itemize
 barplot(xtabs(Freq ~ Admit + Gender, data = UCBAdmissions)) # stacked bar
  chart
@@ -16621,6 +16685,17 @@
 
 \end_deeper
 \begin_layout Itemize
+Spine plots
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+spineplot(xtabs(Freq ~ Admit + Gender, data = UCBAdmissions)) # rescaled
+ barplot
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
 Quantile-quantile plots: There are two ways to do this.
  One way is to compare two independent samples (of the same size).
  qqplot(x,y).
@@ -17058,11 +17133,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -18898,10 +18968,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 In this chapter we define the basic terminology associated with probability
  and derive some of its properties.
@@ -18983,6 +19049,75 @@
 what we mean by 'random variables', and where they come from
 \end_layout
 
+\begin_layout Standard
+\begin_inset Float figure
+wide false
+sideways false
+status open
+
+\begin_layout Scrap
+\align center
+<<echo = FALSE, fig = TRUE, width = 4.5, height = 2.75>>=
+\begin_inset Newline newline
+\end_inset
+
+require(diagram)
+\begin_inset Newline newline
+\end_inset
+
+par(mex = 0.2, cex = 0.5)
+\begin_inset Newline newline
+\end_inset
+
+openplotmat(frame.plot=TRUE)
+\begin_inset Newline newline
+\end_inset
+
+straightarrow(from = c(0.46,0.74), to = c(0.53,0.71), arr.pos = 1)
+\begin_inset Newline newline
+\end_inset
+
+straightarrow(from = c(0.3,0.65), to = c(0.3,0.51), arr.pos = 1)
+\begin_inset Newline newline
+\end_inset
+
+textellipse(mid = c(0.74,0.55), box.col = grey(0.95), radx = 0.24, rady = 0.22,
+ lab = c(expression(bold(underline(DETERMINISTIC))), expression(2*H[2]+O[2]
+ %->% H[2]*O), "3 + 4 = 7"), cex = 2 )
+\begin_inset Newline newline
+\end_inset
+
+textrect(mid = c(0.3, 0.75), radx = 0.15, rady = 0.1, lab = c("Experiments"),
+ cex = 2 )
+\begin_inset Newline newline
+\end_inset
+
+textellipse(mid = c(0.29,0.25), box.col = grey(0.95), radx = 0.27, rady = 0.22,
+ lab = c(expression(bold(underline(RANDOM))), "toss coin, roll die", "count
+ ants on sidewalk", "measure rainfall" ), cex = 2 )
+\begin_inset Newline newline
+\end_inset
+
+@
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Caption
+
+\begin_layout Plain Layout
+Two types of experiments
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
 \begin_layout Section
 Sample Spaces
 \begin_inset CommandInset label
@@ -19022,7 +19157,7 @@
 \end_inset
 
 .
- For the coin-toss experiment, 
+ For a coin-toss experiment, 
 \begin_inset Formula $S$
 \end_inset
 
@@ -19349,7 +19484,7 @@
 \color inherit
  package
 \begin_inset Foot
-status open
+status collapsed
 
 \begin_layout Plain Layout
 The seasoned 
@@ -31860,11 +31995,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -32011,10 +32141,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 In this chapter we introduce discrete random variables, those who take values
  in a finite or countably infinite support set.
@@ -32433,7 +32559,7 @@
 \begin_inset Formula $\E X$
 \end_inset
 
-:
+ (which we will discuss later):
 \begin_inset Formula \begin{equation}
 \mu=\E X=\sum_{x\in S}xf_{X}(x),\end{equation}
 
@@ -32446,7 +32572,7 @@
  is convergent.
  Another important number is the variance:
 \begin_inset Formula \begin{equation}
-\sigma^{2}=\E(X-\mu)^{2}=\sum_{x\in S}(x-\mu)^{2}f_{X}(x),\end{equation}
+\sigma^{2}=\sum_{x\in S}(x-\mu)^{2}f_{X}(x),\end{equation}
 
 \end_inset
 
@@ -32458,7 +32584,7 @@
 \end_inset
 
 ) with the alternate formula 
-\begin_inset Formula $\sigma^{2}=\E X^{2}-(\E X)^{2}$
+\begin_inset Formula $\sigma^{2}=\sum x{}^{2}f_{X}(x)-\mu^{2}$
 \end_inset
 
 .
@@ -33170,13 +33296,13 @@
 .
  To get the variance we first calculate
 \begin_inset Formula \[
-\E X^{2}=\frac{1}{m}\sum_{x=1}^{m}x^{2}=\frac{1}{m}\frac{m(m+1)(2m+3)}{6}=\frac{(m+1)(2m+1)}{6},\]
+\sum_{x=1}^{m}x^{2}f_{X}(x)=\frac{1}{m}\sum_{x=1}^{m}x^{2}=\frac{1}{m}\frac{m(m+1)(2m+1)}{6}=\frac{(m+1)(2m+1)}{6},\]
 
 \end_inset
 
  and finally,
 \begin_inset Formula \begin{equation}
-\sigma^{2}=\E X^{2}-(\E X)^{2}=\frac{(m+1)(2m+1)}{6}-\left(\frac{m+1}{2}\right)^{2}=\cdots=\frac{m^{2}-1}{12}.\end{equation}
+\sigma^{2}=\sum_{x=1}^{m}x^{2}f_{X}(x)-\mu^{2}=\frac{(m+1)(2m+1)}{6}-\left(\frac{m+1}{2}\right)^{2}=\cdots=\frac{m^{2}-1}{12}.\end{equation}
 
 \end_inset
 
@@ -39133,11 +39259,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -39743,10 +39864,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 The focus of the last chapter was on random variables whose support can
  be written down in a list of values (finite or countably infinite), such
@@ -41042,6 +41159,19 @@
 \end_layout
 
 \begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO: put in proof of this with a change of variables
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
 The MGF of 
 \begin_inset Formula $Z\sim\mathsf{norm}(\mathtt{mean}=0,\,\mathtt{sd}=1)$
 \end_inset
@@ -41106,6 +41236,19 @@
 .
 \end_layout
 
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO: put in how to get mean and variance of Normal
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
 \begin_layout Fact
 The same argument above shows that if 
 \begin_inset Formula $X$
@@ -44661,11 +44804,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -44964,10 +45102,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 We have built up quite a catalogue of distributions, discrete and continuous.
  They were all univariate, however, meaning that we only considered one
@@ -53197,11 +53331,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -53342,10 +53471,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 This is an important chapter; it is the bridge from probability and descriptive
  statistics that we studied in Chapters 
@@ -55983,11 +56108,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -56643,10 +56763,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 We will discuss two branches of estimation procedures: point estimation
  and interval estimation.
@@ -60892,11 +61008,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -60997,10 +61108,6 @@
 
 \end_layout
 
-\begin_layout Standard
-\begin_inset Branch main
-status open
-
 \begin_layout Paragraph*
 What do I want them to know?
 \end_layout
@@ -63985,11 +64092,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -64028,10 +64130,6 @@
 
 \end_layout
 
-\begin_layout Standard
-\begin_inset Branch main
-status open
-
 \begin_layout Paragraph*
 What do I want them to know?
 \end_layout
@@ -71591,11 +71689,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -71714,10 +71807,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 We know a lot about simple linear regression models, and a next step is
  to study multiple regression models that have more than one independent
@@ -80129,7 +80218,7 @@
 \begin_layout Standard
 \align center
 \begin_inset Flex URL
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
@@ -80141,6 +80230,51 @@
 
 \end_layout
 
+\begin_layout Standard
+Here is an example of how it works, based on a question from R-help.
+\end_layout
+
+\begin_layout Scrap
+<<>>=
+\begin_inset Newline newline
+\end_inset
+
+# fake data 
+\begin_inset Newline newline
+\end_inset
+
+set.seed(1) 
+\begin_inset Newline newline
+\end_inset
+
+x <- seq(from = 0, to = 1000, length.out = 200) 
+\begin_inset Newline newline
+\end_inset
+
+y <- 1 + 2*(sin((2*pi*x/360) - 3))^2 + rnorm(200, sd = 2)
+\begin_inset Newline newline
+\end_inset
+
+plot(x, y)
+\begin_inset Newline newline
+\end_inset
+
+acc.nls <- nls(y ~ a + b*(sin((2*pi*x/360) - c))^2, start = list(a = 0.9,
+ b = 2.3, c = 2.9))
+\begin_inset Newline newline
+\end_inset
+
+summary(acc.nls)
+\begin_inset Newline newline
+\end_inset
+
+#plot(x, fitted(acc.nls))
+\begin_inset Newline newline
+\end_inset
+
+@
+\end_layout
+
 \begin_layout Subsection
 Multicollinearity
 \begin_inset CommandInset label
@@ -80279,11 +80413,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -80360,10 +80489,6 @@
 \end_layout
 
 \begin_layout Standard
-\begin_inset Branch main
-status open
-
-\begin_layout Standard
 \noindent
 Computers have changed the face of statistics.
  Their quick computational speed and flawless accuracy, coupled with large
@@ -82715,11 +82840,6 @@
 
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \begin_layout Section*
 Chapter Exercises
 \end_layout
@@ -83794,11 +83914,6 @@
 
 \end_layout
 
-\begin_layout Standard
-\noindent
-\begin_inset Branch main
-status open
-
 \begin_layout Chapter
 Data
 \begin_inset CommandInset label
@@ -92140,10 +92255,5 @@
 @
 \end_layout
 
-\end_inset
-
-
-\end_layout
-
 \end_body
 \end_document

Modified: www/book/download/IPSUR.zip
===================================================================
(Binary files differ)

Modified: www/book/topMenu.php
===================================================================
--- www/book/topMenu.php	2010-09-21 18:25:36 UTC (rev 185)
+++ www/book/topMenu.php	2010-10-09 03:37:46 UTC (rev 186)
@@ -1,10 +1,11 @@
 <div id="navMenu">
   <table width="700" border="0" cellspacing="0" cellpadding="0">
     <tr>
-	<td width="175" align="center" valign="middle"><div align="center"><a href="index.php">Home</a></div></td>
-	<td width="175" align="center" valign="middle"><div align="center"><a href="installation.php">Installation</a></div></td>
-	<td width="175" align="center" valign="middle"><div align="center"><a href="downloads.php">Downloads</a></div></td>
-	<td width="175" align="center" valign="middle"><div align="center"><a href="feedback.php">Feedback</a></div></td>
+	<td widh="140" align="center" valign="middle"><div align="center"><a href="index.php">Home</a></div></td>
+	<td width="140" align="center" valign="middle"><div align="center"><a href="installation.php">Installation</a></div></td>
+	<td width="140" align="center" valign="middle"><div align="center"><a href="downloads.php">Downloads</a></div></td>
+	<td width="140" align="center" valign="middle"><div align="center"><a href="resources.php">Resources</a></div></td>
+	<td width="140" align="center" valign="middle"><div align="center"><a href="feedback.php">Feedback</a></div></td>
     </tr>
   </table>
 </div>



More information about the IPSUR-commits mailing list