The magrittr package adds a set of tools called pipes to R. We need it for this

The magrittr package adds a set of tools called pipes to R. We need it for this

The magrittr package adds a set of tools called pipes to R. We need it for this exam: install.packages(“magrittr”).
Rewrite the following function calls using pipes, with x <- 1:8 (and submit in the plain text the solutions): 1. add a new variable rev_per_minute using a pipe (below is how it is done without pipe so it has to be replaced) age <- c(28, 48, 47, 71, 22, 80, 48, 30, 31) purchase <- c(20, 59, 2, 12, 22, 160, 34, 34, 29) visit_length <- c(5, 2, 20, 22, 12, 31, 9, 10, 11) bookstore <- data.frame(age, purchase, visit_length) 2. sqrt(mean(x)) 3. assign("x", 25) 4. sort(x^2+5)[1:2] Attached grading rubric

Posted in R

The Prostate Dataset The prostate dataset comes from a study on 97 men with pros

The Prostate Dataset
The prostate dataset comes from a study on 97 men with pros

The Prostate Dataset
The prostate dataset comes from a study on 97 men with prostate cancer who were due to receive radical prostatectomy.
The data contain the following variables:
lcavol: log(cancer volume in cm3)
lweight: log(prostate weight in gm)
age: age in years
lbph: log(benign prostatic hyperplasia amount)
svi: seminal vesicle invasion
lcp: log(capsular penetration)
Gleason: Gleason score
pgg45: percentage Gleason scores 4 or 5
lpsa: log(prostate specific antigen in ng/mL)
Question 1
Validate that the prostate data frame contains 97 observations.
Hint: First install the faraway package (if you haven’t already) as instructed on Lesson 1, Slide 49. The following R statement will load the prostate data frame:data(“prostate”, package = “faraway”).
Use the nrow() function to see how many overvaluations (rows) the data frame has. For example: the following statement prints the number of observations in the car data frame: nrow(cars).
Question 2
Calculate descriptive statistics of each of the variables.
Hint: Use the summary() function. For example: summary(cars).
Question 3
Create a new data frame that includes the following variables: lcavol, lweight, age and lpsa.
Use this new data frame for all questions below.
Hint: In the following example, we select two variables (agegp and alcgp) from the esoph data frame and name the new data frame esophSubDf
esophSubDf <- esoph[c("agegp", "alcgp")] Question 4 Calculate descriptive statistics of each of the variables using the new data frame. Question 5 Create a scatter plot matrix for all the variables using the new data frame. Hint: Use the pairs() function (see Lesson 2, Slide 50). Question 6 Create a (Pearson) correlation matrix for all the variables. Hint: Use the cor() function (see Lesson 2, Slide 48). Question 7 Show the same matrix again, but round the correlations (use two decimal places). Hint: Use the round() function. The following example calculates the correlation matrix for the cars data frame and rounds the numbers: round(cor(cars),2) Question 8 Create a regression model: The predictor variable (X) should be lpsa. The outcome variable (Y) should be lcavol. Show the summary of the model. Hint: Use the lm() and summary() functions (see Lesson 2, Slide 51). Question 9 Visualize the two variables and the model you just created by doing the following: Create a scatter plot. Put lcavol in the y-axis and lpsa in the x-axis. Include the regression line and label the axis. Hint: See Lesson 2, Slide 52. Question 10 Update the regression model by adding a second predictor: age Show the regression model summary Hint: See Lesson 2, Slide 53.

Posted in R

Using a new dataset, select two qualitative variables and two quantitative varia

Using a new dataset, select two qualitative variables and two quantitative varia

Using a new dataset, select two qualitative variables and two quantitative variables. Explain why you selected these variables.
Analysis:
For your qualitative variables, create a contingency table and calculate the association between them.
For your quantitative variables, calculate the correlation between them. Include a scatter plot to visually represent this relationship.
Interpretation: Explain your findings. What does the association or correlation say about the relationship between your variables? Is the relationship strong, weak, positive, negative, or nonexistent?
Reflection: Reflect on the importance of understanding associations and correlations in data analysis and how they can guide further data investigation.
Submission Format: Your submission should be a maximum of 500-600 words. Submit your assignment in APA format as a Word document or a PDF file. Include your written analysis and any tables or visualizations that support your findings. If you used any software for your calculations (like R, Python, Excel), please include your code or formulas as well. Include an APA-formatted reference list for any external resources used.

Posted in R

I have attached 3 files needed for this assignment. First file : “Homework 2-2.

I have attached 3 files needed for this assignment.
First file : “Homework 2-2.

I have attached 3 files needed for this assignment.
First file : “Homework 2-2.docx” Is the assignment that has description and questions I need to complete. You need to focus on Problem2: Parts B,C, & E only
Second file: “Week3 Lecture Notes.docx”- are notes that can help you with the assignment.
Third File: “Week 4Class 1 lecture”-this file is a layout of how you are suppose to answer the questions for problem 2 part,c, and e.
I have already completed problem 1 so I uploaded this file because that’s the format you are suppose to use when you answer those questions

Posted in R

#Create the following data frame a. use the UNITID as the row name; are you able

#Create the following data frame a. use the UNITID as the row name; are you able

#Create the following data frame a. use the UNITID as the row name; are you able to use
#SEGMENT_ID as the row name? b. Set the column SEGMENT_ID as factor
#c.Check the class of the data frame
#UNITID SEGMENT_ID MW PRICE
#AYER band1 135 24
#SHUER band1 230 50
#BUSHA band1 105 26
#MINA band1 97 34
#TEUA band1 300 74

Posted in R

You are a data analyst working for a nonprofit organization that reviews busines

You are a data analyst working for a nonprofit organization that reviews busines

You are a data analyst working for a nonprofit organization that reviews business. You have been tasked to provide a briefing on consumer complaints. Using this Web site (https://catalog.data.gov/dataset/consumer-complaint-database), which has over 200,000 records, analyze the data, and provide insight regarding the following:
Which type of product had the most complaints ordered by state?
How many complaints have been filed for each company?
Summarize the responses for each company (i.e., 32 in progress, 67 closed, and 22 closed with explanation).

Posted in R

Hi! Can you create functions to visualize splines and smothing on the female RAV

Hi! Can you create functions to visualize splines and smothing on the female RAV

Hi! Can you create functions to visualize splines and smothing on the female RAVDESS dataset? -Consider the data of your gender of the dataset RAVDESS.
Explore the data and represent your data as functions, choosing a suitable basis -: Try to find the ‘right smoothing’ to fit your data on facial videos from the RAVDESS
dataset. I’ll send you the two lectures you can check and follow to create the functions on the female dataset. PLEASE COMMENT ALL THE STEPS Thank you very much!

Posted in R

Choose one dataset , select two qualitative variables and two quantitative varia

Choose one dataset , select two qualitative variables and two quantitative varia

Choose one dataset , select two qualitative variables and two quantitative variables. Explain why you selected these variables.
Analysis:
For your qualitative variables, create a contingency table and calculate the association between them.
For your quantitative variables, calculate the correlation between them. Include scatter plot to visually represent this relationship.
Interpretation: Explain your findings. What does the association or correlation say about the relationship between your variables? Is the relationship strong, weak, positive, negative, or nonexistent?
Reflection: Reflect on the importance of understanding associations and correlations in data analysis and how they can guide further data investigation.
Submission Format: Your submission should be a maximum of 500-600 words. Submit your assignment in APA format as a Word document or a PDF file. Include both your written analysis and any visualizations or tables that support your findings. If you use any software for your calculations (like R, Python, Excel or RapidMiner), please include your code or formulas as well.

Posted in R

I’m working on a r project and need support to help me learn. Hi, I need someon

I’m working on a r project and need support to help me learn. Hi, I need someon

I’m working on a r project and need support to help me learn. Hi, I need someone to help me correct some issues in my codes for a project presentation. I want all the codes to run properly, then you to knit the file and send me the pdf and all the tables. You can add a model evaluation table of all supervised models listing all the models and their ROC values.This an eample:
Model <- c('Decision Tree-C5.0','Random Forest','kNN','SVM-vanilladot') Accuracy_percent <- c(88.57,88.32,88.29,88.00) mytable<- data.frame(Model, Accuracy_percent) qplot(1:10, 1:10, geom = "blank") + theme(line = element_blank(), text = element_blank()) + annotation_custom(grob = tableGrob(mytable))

Posted in R

I want all the codes to run properly, then you to knit the file and send me the

I want all the codes to run properly, then you to knit the file and send me the

I want all the codes to run properly, then you to knit the file and send me the pdf and all the tables.
Once you figure out all acuracy values you can add a table to compare the values of the supervised models, as this one:
Model <- c('Decision Tree-C5.0','Random Forest','kNN','SVM-vanilladot') Accuracy_percent <- c(88.57,88.32,88.29,88.00) mytable<- data.frame(Model, Accuracy_percent) qplot(1:10, 1:10, geom = "blank") + theme(line = element_blank(), text = element_blank()) + annotation_custom(grob = tableGrob(mytable))

Posted in R