Create macro for statistic tests

I have some statisticals test to do like chisq test and I would like to do macro to execute them.
This is my original code

table(base$grp,base$resulfinal)
A = matrix(c(1, 1, 19, 37, 0, 3, 15, 36), nrow = 2, byrow = T)
chisq.test(A)

and this is what I try :

qtn_fct <- function(var){
  chisq.test(base$grp,base$var)} 
#or chisq.test(base$grp,base[[var]])}

qtn_fct(var=resulfinal)

It doesn't work I don't know what else I can do.
Also, if someone knows a lot in statistics test, please contact me in DM I could be interested.
Thank you for your time!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.