actually other expert help me with a solution for hw1 (thanks a lot for him). so , if you look just the question that I post you can see it or just write the first line of the question , thank you for your interest in my question . I post the code that I used at first homework
# Set directory to data folder
setwd("C:data")
# getwd()
# Read data from csv file
data <- read.csv("SweetPotatoFirmness.csv",header=TRUE, sep=",")
head(data)
str(data)
# scatterplot of independent and dependent variables
plot(data$pectin,data$firmness,xlab="Pectin, %",ylab="Firmness")
par(mfrow = c(2, 2)) # Split the plotting panel into a 2 x 2 grid
model <- lm(firmness ~ pectin , data=data)
summary(model)
plot(model)
par(mfrow=c(1,1))
# Residual Plot
data$residuals <- resid(model)
data$predict <- predict(model)
plot(data$predict,data$residuals,xlab="Fitted Values",ylab="Residuals")
# Estimated regression line and scatterplot of data
plot(data$pectin,data$firmness,xlab="Pectin, %", ylab="Firmness",
ylim=c(45,75),xlim=c(0,3),main="Simple Linear Regression",
pch=19,cex=1.5)
lines(sort(data$pectin),fitted(model)[order(data$pectin)], col="blue", type="l")
actually other expert help me with a solution for hw1 (thanks a lot for him). so...
For expert using R , I solve it but i need to figure out what I got is correct or wrong. Thank you # Simple Linear Regression and Polynomial Regression # HW 2 # # Read data from csv file data <- read.csv("C:\data\SweetPotatoFirmness.csv",header=TRUE, sep=",") head(data) str(data) # scatterplot of independent and dependent variables plot(data$pectin,data$firmness,xlab="Pectin, %",ylab="Firmness") par(mfrow = c(2, 2)) # Split the plotting panel into a 2 x 2 grid model <- lm(firmness ~ pectin , data=data) summary(model) anova(model) plot(model)...
Please I want someone help me to solve this question a,b,c,d,e I’m not sure about my solution This is the data # Set directory to data folder setwd("C:data") # getwd() # Read data from csv file data <- read.csv("SweetPotatoFirmness.csv",header=TRUE, sep=",") head(data) str(data) # scatterplot of independent and dependent variables plot(data$pectin,data$firmness,xlab="Pectin, %",ylab="Firmness") par(mfrow = c(2, 2)) # Split the plotting panel into a 2 x 2 grid model <- lm(firmness ~ pectin , data=data) summary(model) plot(model) par(mfrow=c(1,1)) # Residual Plot data$residuals...
1. Consider data from a study of the association between vapor pressure (in mm and temperature (in degrees K). The vapor pressure y is the response and the temperature x is the predictor. We import the data with R and display a few rows. Hg) of water > vapor<-read.csv("VaporPressure.csv") > head(vapor) Temp.. in.K. Vapor.Pressure 4.6 1 273 283 9.2 2 3 293 17.5 4 303 31.8 313 55.3 323 92.5 (a) Here is a scatter plot of vapor pressure against...
PLEASE ANSWER ALL parts . IF YOU CANT ANSWER ALL, KINDLY ANSWER PART (E) AND PART(F) FOR PART (E) THE REGRESSION MODEL IS ALSO GIVE AT THE END. REGRESSION MODEL: We will be returning to the mtcars dataset, last seen in assignment 4. The dataset mtcars is built into R. It was extracted from the 1974 Motor Trend US magazine, and comcaprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973-74 models). You can find...
please answer the following using the r code provided . The data set below contains information about the gasoline mileage performance for 32 au- tomobiles. We are interested in developing a model to predict the miles per gallon () using related predictor variables. The variables in the study are Dependent variable: Miles per gallon (v) Independent variables: ri horsepower (ft-lb) ra: torque (ft-lb) r: horsepower+torque (ft-lb) rs: carburetor (barrels) (a) We first start by fitting a model using y and...
Help & explain please Regression 1. A researcher is willing to investigate whether there is any linear relation bet ween income (x) in thousand dollars and food expenditures (y) in hundred dollars. A sample data on 7 households given the table below was collected. Assuming that a linear model is used to solve the problem. r-3-D) r-I 83 24 13 61 15 17 1. Write down the linear model 2. Write down the fitted regression line and Interpret the slope...