1. Run the following code to generate a sample of size 50 from the Student t distribution with degree of freedom 30, and then:

set.seed(57)
x <- rt(n=50,df=30)

2. Run the following simulation code first and then:

set.seed(1234)
x <- rnorm(1000, 3, 0.5)
y <- 3-5*x+3*rnorm(1000)

3. Run the following simulation code first and then choose an appropriate test to compare the mean of sample x1 and x2. And then check the sample sizes.

set.seed(57)
x1 <- rnorm(30, 2.2, 1)
x2 <- rnorm(30, 2.0, 1)

4. Run the following simulation first and then:

set.seed(1234)
r <- runif(1000, -pi,pi)
x <- 16*sin(r)^3
y <- 13*cos(r)-5*cos(2*r)-2*cos(3*r)-cos(4*r)+rnorm(1000)

5. Run the following simulation code first and then:

set.seed(1234)
x <- rnorm(1000, 5, 2)
y <- 3+5*x+rnorm(1000)

6. Run the following code to attach a dataset first. Then test the linear association between variable HEARTRTE and variable BMI while adjusting for variable age effect on HEARTRTE.

data("DIGdata", package="asympTest")
attach(DIGdata)

7. Run the following simulation code first and then

set.seed(1234)
x <- rbinom(1000, 1, 0.5)
y <- 3+15*x+rnorm(1000)