Chat with us, powered by LiveChat AMDA R Programming Code - STUDENT SOLUTION USA

Description

3 questions and the first one is the details

Homework: Coding questions #2
From the “Learn R. By coding.” (Kurnicki, 2018) textbook:
Chapter 6.7: Exercises: 3,4,5
Hint for ex. 3: the iris dataset is a R built-in dataset. Just type in print(iris) in your console.
Hint for ex. 4: the kyphosis dataset comes from the rpart library – you’ll need to install and load:
install.packages(“rpart”)
library(rpart)
Submit your answers with all your R code in a .pdf format (limit your file to 6 pages). Write commentary/conclusions for
every exercise.
Complete the exercises using the following “answer framework” for each question:
1. Exercise/question number
2. R Code / libraries should be included (important chunks are highlighted)
3. Code output (data frame, vector, chart)
4. A chart/visual, if needed
5. Your comment, conclusions and/or insight into the results.
If your code produces errors and you cannot find a fix, try to explain what this error means. Do not ignore errors!
Here’s how we’ll grade your paper:
– you will receive 4 points (according to the grading rubric) for each exercise listed above,
– we will sum up all your points for all exercises and provide a “total” count of points,
– in addition, we will provide one “average rubric” for all your exercises.
3.Using the iris dataset:
a) combine the Setosa and Versicolor into group ?0? and label the
Virginica to ?1?. Create a new variable called iris$Group with the
0 or 1 labels,
77
6.7 Exercises
b) build a logistic regression model using any available data that
will predict the observation being Virginica ( value of 1 in Group
variable)
c) calculate the probability of a new plant being a Virginica for the
following parameters:
Sepal.Width =5
Petal.Length =10
Petal.Width = 7
Sepal.Length=9
4.Using the kyphosis dataset:
a) convert the kyphosis$Kyphosis variable to numeric, assign a 1
to present and a 0 to absent,
b) build a logistic regression using all other variables and
estimate the probability of the observation having a ?present?
hyphosis. What can you say about the coefficients? Are the
significant?
c) calculate the probability of kyphosis being ?present? for the
following observation: Age=50, Start=10, Number=5.
5. Using all the single variable regressions from Exercise 1, test if
the variable pairs are homoscedastic or heteroscedastic. Plot
your findings. Using the plot(x=my_x_variable, y=my_y_variable,
type=”p”) function. Use my_data$variable_name to define x and y
variables in the function.

Purchase answer to see full
attachment

error: Content is protected !!