For a few weeks, I've been trying to figure out whether the results I've received from conducting a one-way ANOVA test are correct if so how. (I have parsed data containing null values & Alpha Numeric values)
My Data :
sal = read.csv("/Salaries.csv", header = TRUE)
sal$Position - Prof AsstProf AssocProf
sal$Salary - ranging from 50,000 to 260,000
library("nortest")
oneway.test(Salary ~ Position,data=sal)
Results :
One-way analysis of means (not assuming equal variances)
data: Salary and Position
F = 271.44, num df = 2.00, denom df = 177.19, p-value < 2.2e-16
aovSumW <- aov(Salary ~ Position, data=sal)
Results :
> summary(aovSumW)
Df Sum Sq Mean Sq F value Pr(>F)
Position 2 1.432e+11 7.162e+10 128.2 <2e-16 ***
Residuals 394 2.201e+11 5.586e+08
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# Using Factor
aovSum <- aov(Salary ~ as.factor(Position), data=sal)
Results :
aov(formula = Salary ~ as.factor(Position), data = sal)
Terms:
as.factor(Position) Residuals
Sum of Squares 143231765736 220068876825
Deg. of Freedom 2 394
Residual standard error: 23633.67
Estimated effects may be unbalanced
summary(aovSum)
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(Position) 2 1.432e+11 7.162e+10 128.2 <2e-16 ***
Residuals 394 2.201e+11 5.586e+08
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Followed :
https://rpubs.com/ibecav/308410 - The most suitable resource https://rpubs.com/heruwiryanto/Anova_linear
I'm not really sure whether what I have done is correct statistically correct or if it is an invalid result can someone please tell if I am doing this correctly using R.