This below basically works, but 'var1' is not working. In SAS, this would be "&var1". How do I do that in R?
kaz_macro2<-function(var1){
x1<- Summarize(GrowthMindset ~ treat+ dataID, data=var1)
x1$varname<-"GrowthMindset"
x1$sample_type<-'var1'
x2<- Summarize(SelfEfficacy ~ treat+ dataID, data=var1)
x2$varname<-"SelfEfficacy"
x2$sample_type<-'var1'
x3<- Summarize(MSelfEfficacy ~ treat+ dataID, data=var1)
x3$varname<-"MSelfEfficacy"
x3$sample_type<-'var1'
x4<- Summarize(MathAnxiety ~ treat+ dataID, data=var1)
x4$varname<-"MathAnxiety"
x4$sample_type<-'var1'
x5<- Summarize(TeacherUse ~ treat+ dataID, data=var1)
x5$varname<-"TeacherUse"
x5$sample_type<-'var1'
as.data.frame(rbind(x1,x2,x3,x4,x5))
}
temp1234<-kaz_macro2(wholedata2)