I am currently writing a code in R attempting to compare 2 yes/no categories for statistical significance. I used a chi-squared test however am unsure if that is the correct analysis for my data. Here is my existing script:
DATA FRAME =============
pestResponses.df = read.csv(insertpath)
df1 <- data.frame(pestResponses.df(,4),pestResponses.df(,6))
CHI SQUARE TEST – used to analyze 2 categorical variables ========
I was unable to get a p-value or x-squared value until I changed the ifelse statement to a 2 instead of a 0. Any advice is appreciated, thank you.