Test Driving, knitR
Use the MTCars dataset for this exercise. slide 44 session 3 File attached
This assignment will be somewhat free-form. You will use R functions to perform various tasks on your data, and use knitR to mix in text, code, and output into a single document. When you are done, you will create a pdf, and that pdf will be your final output that you will upload here.
Start with the statistical functions on slide 44 of the Session Three presentation (which i have attached file), looking at MPG.
Below is The second question
Now we’ll integrate more things into our investigation.
First, fix any errors in your previous knitR work before continuing.
Now we’re going to dig into our cars some more. Start by using the lattice library to do a histogram of the mtcars data we’ve been working with. Show a histogram of the mileage of each engine based upon the number of cyl in a single plot. Do the same thing for transmission type and number of gears. Write some thoughts about the results of these observations.
Now we’re going to do some modeling. Instead of doing an aov table of effects, do an aov table of means, modeling mpg and cyl. Do the same thing with mpg and am, and mpg and gear. Write about these observations.
Finally, let’s do a linear model. Write about what you’re about to do, then create a linear model for mpg against weight from the original mtcars dataset. Run a coef of the Model and report it out. Explain in your paper what this accomplishes. Then plot the actual mpg data against the linear model you got earlier from the slope and intercept. Play with some of the other useful functions available. USE LATEX FOR THIS QUESTION
Write a summary of the work you’ve done, and what you believe these observations demonstrate
Sent you session8 PDF for your reference.
install LaTEX is important because I wanted you to be exporting directly from knitR to pdf, which uses LaTEX and gives a specific look to your paper.
in (LaTEX) JUST NEED TO DO INSERT INPUT GET THE OUTPUT AND EXPORT TO PDF