[R] Inference() Function Insisting That I Use ANOVA Versus Two-Sided Hypothesis Test; R/RStudio

Jason Eyerly teamtraders3564 at gmail.com
Sat Oct 4 22:37:08 CEST 2014


Hello All.

I'm trying to use a custom function called Inference() as seen in the code below. There's no documentation for the function, but it is from my DASI class in Coursera. According to the feedback I have received, I am using the function properly. I'm trying to do a two-sided hypothesis test between my class variable and my wordsum variable. However, the function/R/R Studio keep insisting I do an ANOVA test. This doesn't work for me since I'm trying to reject the null, and create a confidence interval between the difference of two independent means. I've looked at the function, but as I'm no R expert, I don't see anything out of the ordinary. Any help is greatly appreciated.

load(url("http://bit.ly/dasi_gss_ws_cl"))
source("http://bit.ly/dasi_inference")

summary(gss)
by(gss$wordsum, gss$class, mean)
boxplot(gss$wordsum ~ gss$class)

gss_clean = na.omit(subset(gss, class == "WORKING" | class =="LOWER"))

inference(y = gss_clean$wordsum, x = gss_clean$class, est = "mean", type = "ht", 
          null = 0, alternative = "twosided", method = "theoretical”)

Returns:

Response variable: numerical, Explanatory variable: categorical
Error: Use alternative = 'greater' for ANOVA or chi-square test.
In addition: Warning message:
Ignoring null value since it's undefined for ANOVA.

Best Regards,
	Jason Eyerly
	[[alternative HTML version deleted]]



More information about the R-help mailing list