DS4PS / cpp-524-spr-2021

http://ds4ps.org/cpp-524-spr-2021/
1 stars 0 forks source link

Omnibus t test #3

Open ekmcintyre opened 3 years ago

ekmcintyre commented 3 years ago

I tried to do the omnibus t test similarly to how we would analyze multiple variables in a multiple regression.

t.test( gender ~ edu.level + 
          years.prof.exp + 
          seed.funding + 
          take.on.debt + 
          most.imp.fund.source + 
          age +
          income, data=dat )

However, I keep getting this error message

Error in t.test.formula(gender ~ edu.level + years.prof.exp + seed.funding + : 'formula' missing or incorrect
lecy commented 3 years ago

Omnibus is not running all t-tests together. You run them separately then use all results together to make one decision.

For a single t-test you would use alpha=0.05. For the omnibus you need to adjust your alpha, then compare it to the lowest p-value.

ekmcintyre commented 3 years ago

I started running t-tests separately. However, I am not able to do t-tests on the factor variables. I get the same error message every time I try with the first 5 variables.

Error in var(x) : Calling var(x) on a factor x is defunct. 
Use something like 'all(duplicated(x)[-1L])' to test for a constant vector.

Would it be acceptable to use the Bonferroni correction on p-values from chi-square tests?

lecy commented 3 years ago

Yes, that is the proper procedure