library(readxl)
## Warning: package 'readxl' was built under R version 4.4.1
pilot<-read_xlsx("C:/Users/user/Downloads/pilot.xlsx")
## New names:
## • `` -> `...1`
head(pilot)
## # A tibble: 5 × 3
## ...1 sikap kerentanan
## <chr> <dbl> <dbl>
## 1 ss 7.62 8.38
## 2 s 32.8 21.0
## 3 n 7.88 16.4
## 4 ts 0.75 2.17
## 5 sts 0 0.15
summary(pilot)
## ...1 sikap kerentanan
## Length:5 Min. : 0.000 Min. : 0.150
## Class :character 1st Qu.: 0.750 1st Qu.: 2.175
## Mode :character Median : 7.625 Median : 8.375
## Mean : 9.800 Mean : 9.605
## 3rd Qu.: 7.875 3rd Qu.:16.375
## Max. :32.750 Max. :20.950
p2 <- lm(sikap~kerentanan, data=pilot)
summary(p2)
##
## Call:
## lm(formula = sikap ~ kerentanan, data = pilot)
##
## Residuals:
## 1 2 3 4 5
## -0.6026 8.4471 -10.5794 0.4481 2.2868
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.4785 5.5441 -0.447 0.6851
## kerentanan 1.2783 0.4433 2.883 0.0633 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.939 on 3 degrees of freedom
## Multiple R-squared: 0.7349, Adjusted R-squared: 0.6465
## F-statistic: 8.314 on 1 and 3 DF, p-value: 0.06335
plot(pilot$sikap,pilot$kerentanan,pch=16,xlab="Sikap",ylab="Kerentanan")
abline(p2,col="red")

anova(p2)
## Analysis of Variance Table
##
## Response: sikap
## Df Sum Sq Mean Sq F value Pr(>F)
## kerentanan 1 524.01 524.01 8.3145 0.06335 .
## Residuals 3 189.07 63.02
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1