I want to assign a variable, "dv1" that will pass a given variable name into a formula so that I can create dynamic data references.
Code
# Define terms
esto1<-g6e ### temporarily stored variable #1
esto2<-g6c ### temporarily stored variable #2, etc.
dv1<-"attitude" ### The dependent variable that you'll be testing
#
shapiro.test(esto1$dv1)
shapiro.test(esto2$dv1)
# Given esto1=g6e, esto2=g6c, and dv1=attitude, the statements above should be the equivalent of:
shapiro.test(g6e$attitude)
shapiro.test(g6c$attitude)