Regression

data1 <- read.csv("by_student_for_learning_sato.csv")
# survey_pre_ave = survey_ave - survey_pre

Fomula

# Model1 yはsurvey_ave
model1 <- lm(survey_ave ~ Diagram.use * condition + survey_pre, data = data1)
summary(model1)
## 
## Call:
## lm(formula = survey_ave ~ Diagram.use * condition + survey_pre, 
##     data = data1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.42108 -0.44367  0.00042  0.50789  2.59884 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             1.33617    0.25098   5.324 3.70e-07 ***
## Diagram.use             1.40269    0.38793   3.616  0.00041 ***
## conditionY             -0.22863    0.19770  -1.156  0.24936    
## survey_pre              0.52580    0.06919   7.600 3.13e-12 ***
## Diagram.use:conditionY  1.32284    0.59565   2.221  0.02788 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8115 on 148 degrees of freedom
##   (7 observations deleted due to missingness)
## Multiple R-squared:  0.4594, Adjusted R-squared:  0.4448 
## F-statistic: 31.44 on 4 and 148 DF,  p-value: < 2.2e-16
# Model2 yは増減量(ave-pre)
model2 <- lm(survey_pre_ave ~ Diagram.use * condition, data = data1)
summary(model2)
## 
## Call:
## lm(formula = survey_pre_ave ~ Diagram.use * condition, data = data1)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.1664 -0.4188  0.0596  0.5262  3.3739 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)   
## (Intercept)            -0.07451    0.16431  -0.453  0.65089   
## Diagram.use             1.29683    0.44341   2.925  0.00399 **
## conditionY             -0.15914    0.22585  -0.705  0.48216   
## Diagram.use:conditionY  0.95059    0.67854   1.401  0.16331   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9283 on 149 degrees of freedom
##   (7 observations deleted due to missingness)
## Multiple R-squared:  0.1571, Adjusted R-squared:  0.1401 
## F-statistic: 9.256 on 3 and 149 DF,  p-value: 1.187e-05

Graph

# Model1 graph yはsurvey_ave
library(ggplot2)  

ggplot(data1, aes(x = Diagram.use, y = survey_ave, col = condition)) + geom_point() +geom_smooth(method = "lm",se=FALSE)
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 7 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 7 rows containing missing values (`geom_point()`).

# Model2 graph yは増減量(ave-pre)
library(ggplot2)  

ggplot(data1, aes(x = Diagram.use, y = survey_pre_ave, col = condition)) + geom_point() +geom_smooth(method = "lm",se=FALSE)
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 7 rows containing non-finite values (`stat_smooth()`).
## Removed 7 rows containing missing values (`geom_point()`).

```