Please read through R-Lab 4: on Estimating a Linear Relationship
The R-Lab 4 web page is at http://legacy.ncsu.edu/ST370/distance/rlab/lab4.html
Note: if you would like to have the dataset climate and the function lplot , you can use the source command at the R command line:
> source("http://www-math.cudenver.edu/~bbailey/4830/climate.R")
> source("http://www-math.cudenver.edu/~bbailey/4830/lplot.q")
(At the R command line type climate and lplot hit return to see if you have the dataset and function!)
The dataset earthq can be read into R using the source command:
> source("http://www-math.cudenver.edu/~bbailey/4830/earthq.R")
The dataset vocab can be read into R using the source command:
> source("http://www-math.cudenver.edu/~bbailey/4830/vocab.R")
The dataset meat can be read into R using the source command:
> meat <- read.csv("http://www-math.cudenver.edu/~bbailey/4830/meat.csv", header=T)
Don't forget to log the hours using log(TIME) in the formula statement.
For part (b) and (c), the R predict function will return the standard error (and a confidence interval)
> predict(fit, newdata=data.frame(PH=5), se.fit=T, interval="confidence")(fit is a lm fitted object)
The dataset bigbang2 can be read into R using the source command:
> bigbang2 <- read.csv("http://www-math.cudenver.edu/~bbailey/4830/bigbang2.csv", header=T)