Using ToothGrowth Data in R (data found using R program by
library(datasets) -> data("ToothGrowth") ),
Assume...
Using ToothGrowth Data in R (data found using R program by
library(datasets) -> data("ToothGrowth") ),
Assume that if “len” is above 20, it is classified as “HIGH”;
and ”LOW”, otherwise. Ignore ‘dose’, and determine whether there is
a significant difference in the proportions of the two groups
classified as “HIGH” using a suitable test and a 95% confidence
interval
Consider the anorexia dataset in the MASS package. This data
considers two treatments for anorexia, one...
Consider the anorexia dataset in the MASS package. This data
considers two treatments for anorexia, one based on Cognitive
Behavorial Treatment (CBT) sessions from a professional therapist
and another based on family oriented treatment sessions (FT). The
Treat variable is a factor with three levels: Cont (control, no
treatment), CBT, and FT. For each subject two weights (in lbs) were
measured, one before (Prewt) and one after (Postwt)
treatment.
(a) Create a new variable, Outcome, that indicates if the
post-weight...
Using R and install.packages("MASS"), library(MASS)
1. Generate the following vector using at least two methods.
0,...
Using R and install.packages("MASS"), library(MASS)
1. Generate the following vector using at least two methods.
0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4
2. Generate the following vector.
Apple1, Banana2, Orange3, Cranberry4,
Watermelon5
3. Generate the following vector using the “rep” function.
a, a, b, b, c, c, a, a, b, b, c, c
4. In vector y = (8, 3, 5, 7, 6, 6, 8, 9, 2, 3, 9, 4, 10, 4,
11), which elements of y contains...
Using R or RStudio
After loading the data crime2005 data set from
the library smss, use...
Using R or RStudio
After loading the data crime2005 data set from
the library smss, use (non-robust) linear regression to model the
crime rate per 10,000 people (VI2) as a function of the percentage
of the population that live in metropolitan areas (ME) and the
percentage of the population that live below the poverty line
(PO).
Enter your R code below.
r code
Load the “star” data from the “faraway” package, and model
“temp” using “light”.
library(faraway)...
r code
Load the “star” data from the “faraway” package, and model
“temp” using “light”.
library(faraway)
data(star)
fit = lm(temp ~ light, data = star)
One may also suspect that the residuals (use all the data)
follow a t distribution instead of normal. Using the same logic
that we produced the QQ plot for comparing to the normal
distribution, produce a QQ plot for comparing to a t distribution.
You need to decide the degrees of freedom yourself (consider df...