Assignment_07 pdf

.pdf

School

University of Texas, San Antonio *

*We aren’t endorsed by this school

Course

1403

Subject

Statistics

Date

Apr 30, 2024

Type

pdf

Pages

6

Uploaded by MasterFlower1294 on coursehero.com

11/20/23, 11 : 02 AM Assignment_07 Page 1 of 6 about:srcdoc Biostatistics in R Assignment 7: Analysis of Variance (ANOVA) Lesson Setup Run the next cell to load the necessary R packages for this lesson. [1] "My current working directory is /Users/megancuevas/STATS1403/R assignme nts/Assignment_07" If your current working directory is not correct, you can run the code in the following cell to change it. However, you will need to modify this code to match the folder location on your particular computer system. In [1]: print ( paste ( "My current working directory is" , getwd ())) In [2]: # Do NOT run the code in the cell unless you need to change your current wor # You must edit the pathname to match the location of this assignment on YOU # You must also remove the pound sign # befor the setwd() command before it # setwd("C:/Users/David/Biostats/Assignments/Assignment_04")
11/20/23, 11 : 02 AM Assignment_07 Page 2 of 6 about:srcdoc Introduction to ANOVA (One-Way) The analysis of variance (ANOVA) can be thought of as an extension to the t-test. The independent t-test is used to compare the means of a condition between 2 groups. ANOVA is used when one wants to compare the means of a condition between more than 2 groups. ANOVA is an omnibus test, meaning it tests the data as a whole. Another way to say that is this, ANOVA tests if there is a difference in the mean somewhere in the model (testing if there was an overall effect), but it does not tell one where the difference is if the there is one. To find out where the difference is between the groups, one has to conduct post-hoc tests. This is also covered in this section. Although it can be thought of as an extension of the t-test, in terms of when to use it, mathematically speaking, it’s more of a regression model and is considered a generalized linear model (GLM). ANOVA Assumptions There are 3 assumptions that need to be met for the results of an ANOVA test to be considered accurate and trust worthy. It’s important to note the the assumptions apply to the residuals and not the variables themselves. The ANOVA assumptions are the same as for linear regression and are: Normality Caveat to this is, if group sizes are equal, the F-statistic is robust to violations of normality Homogeneity of variance Same caveat as above, if group sizes are equal, the F-statistic is robust to this violation Independent observations
11/20/23, 11 : 02 AM Assignment_07 Page 3 of 6 about:srcdoc Data Using in this Assignment The data file "Cushing.txt" is part of the R Package called MASS . The data file has 27 rows and 3 columns: TCort The urinary excretion rate (mg/24 hr) of Tetrahydrocortisone PregN The urinary excretion rate (mg/24 hr) of Pregnanetriol Type The type of adrenal cortical tumor coded as a (adenoma), b (bilateral hyperplasia), c (carcinoma) or u for unknown. The date was taken from the following reference J. Aitchison and I. R. Dunsmore (1975) Statistical Prediction Analysis. Cambridge University Press, Tables 11.1–3. (NOTE: The column names have been shorten from the original dataset to make coding easier) The R code in the cell below loads the Cushing's data into dataframe called CushDat and then uses the head() function to print out the first six enteries. TCort PregN Type 3.1 11.70 a 3.0 1.30 a 1.9 0.10 a 3.8 0.04 a 4.1 1.10 a 1.9 0.40 a In [3]: # Loading data CushDat = read.csv ( "Cushings.txt" ) head ( CushDat )
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help