The R Inferno
Patrick Burns1
30th April 2011
1
This document resides in the tutorial section of http:/www.burns-stat.com. More
elementary material on R may also be found there. S+ is a registered trademark of
TIBCO Software Inc. The author thanks D. Aligh
R Reference Card
by Bent Jrgensen, adapted from the R/Rpad Reference Card
by Tom Short. Granted to the public domain. 2011-01-12
update.packages() update packages from CRAN
Pre-loaded packages: base, datasets, graphics, grDevices,
methods, stats, utils
3
R reference card
Essentials
q() quit. You will be asked if Save workspace? type
y to save to .RData in current directory
<- or = assignment, e.g.: x <- 13.76
help(command1) gives syntax, details & examples
Extensions
help.start() start browser help
apropo
Stat 425 HW6
Fritz Scholz
Turn in your results and explanations as a text, doc or pdf le via e-mail by class time, May 16.
Plots can either be integrated into those les, or may be submitted separately.
1. Anatomy of an R function. Execute the following fu
Stat 425 HW4
Fritz Scholz
The purpose of this homework is to understand the power behavior of the two-sample Wilcoxon
test under the randomization scheme encountered so far. In order to do this we need to assume as
known the N = m + n score values Z = (Z1
Stat 425 HW5
Fritz Scholz
Submit your HW 5 (explanations and code)
as a text le with accompanying 2 plot les (jpg or pdf ),
or with text and plots within a .doc or .pdf le.
The purpose of this homework is to understand the power behavior of the two-sample
Stat 425 HW2
Fritz Scholz Chapter 1, Section 4, Problem 46.: To test the effectiveness of vitamin B1 in stimulating growth in mushrooms, vitamin B1 was applied to 13 mushrooms selected at random from a group of 24, while the remaining 11 did not receive t
Stat 425 HW9
Fritz Scholz
1. This problem is about examining the power behavior of the Kruskal-Wallis test when
dealing with 3 treatment groups of sizes n1 , n2 , n3 with n1 + n2 + n3 = N . For a level
test we reject the null hypothesis H0 whenever the K
Stat 425 HW3
Fritz Scholz
Turn in this assignment electronically by e-mail
as a WordPad text-le, showing R code and results.
Cut and paste your R commands or functions
into that le and provide appropriate commentary.
1. In the context of Example 5 of the
Stat 425 HW8
Fritz Scholz
1. Suppose that in the comparison of a new with a standard headache remedy (Chapter 3,
Example 1), the expressions of preference for the new drug by nine subjects are as follows:
Much more
Somewhat more
No dierence
Somewhat less
Stat 425 HW7
Turn in as text, doc or pdf le via e-mail.
Fritz Scholz
1. In a study of the eectiveness of eye exercises in improving near-sightedness, N matched pairs
of children are assigned at random to treatment (an hour's supervised exercise daily) or
Stat 425 HW9 and Solutions
Fritz Scholz
1. This problem is about examining the power behavior of the Kruskal-Wallis test when
dealing with 3 treatment groups of sizes n1 , n2 , n3 with n1 + n2 + n3 = N . For a level
test we reject the null hypothesis H0
Stat 425 HW8 Solutions
Fritz Scholz
1. Suppose that in the comparison of a new with a standard headache remedy (Chapter 3,
Example 1), the expressions of preference for the new drug by nine subjects are as follows:
Much more
Somewhat more
No dierence
Some
Stat 425 HW7 Solutions
Fritz Scholz
1. In a study of the eectiveness of eye exercises in improving near-sightedness, N matched pairs
of children are assigned at random to treatment (an hour's supervised exercise daily) or control (no
special exercises). S
Stat 425 HW6 Solutions
Fritz Scholz
1.
> Using.get()
[1] -2.1298417 1.1478961 -0.4895019 0.8263438 -0.4099352
>
set.seed(26)
>
rnorm(5)
[1] -2.1298417 1.1478961 -0.4895019 0.8263438 -0.4099352
# we got the same set of numbers, thus Using.get appears to do
Stat 425 HW5 Solution
Fritz Scholz
The code for the two functions Ranksum.sim and power.fun is given at the end. Note that
power.fun sets up the plotting grid from 0 to the .99-quantile based on the second normal
approximation. This adapts the relevant pl
Stat 425 HW4 Solution
Fritz Scholz
The purpose of this homework is to understand the power behavior of the two-sample Wilcoxon
test under the randomization scheme encountered so far. In order to do this we need to assume as
known the N = m + n score value
Stat 425 HW2 Solutions
Fritz Scholz
Chapter 1, Section 4, Problem 46.:
To test the eectiveness of vitamin B1 in stimulating growth in mushrooms, vitamin B1 was
applied to 13 mushrooms selected at random from a group of 24, while the remaining 11 did not
r
Stat 425 HW1 Solutions
Fritz Scholz
Chapter 1, Section 1, Problem 8.:
In a study of a new approach to elementary mathematics. 10 children are selected at random from a
group of 21 to be taught by the new method with the other 11 serving as controls. Find