"함수 lm()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight , -</source> +</syntaxhighlight>))
 
4번째 줄: 4번째 줄:
[[분류: R]]
[[분류: R]]
{{참고|R lm()}}
{{참고|R lm()}}
<source lang='r'>
<syntaxhighlight lang='r'>
x <- c(151, 174, 138, 186, 128, 136, 179, 163, 152, 131)
x <- c(151, 174, 138, 186, 128, 136, 179, 163, 152, 131)
y <- c(63, 81, 56, 91, 47, 57, 76, 72, 62, 48)
y <- c(63, 81, 56, 91, 47, 57, 76, 72, 62, 48)
36번째 줄: 36번째 줄:
# Multiple R-squared:  0.9548, Adjusted R-squared:  0.9491  
# Multiple R-squared:  0.9548, Adjusted R-squared:  0.9491  
# F-statistic: 168.9 on 1 and 8 DF,  p-value: 1.164e-06
# F-statistic: 168.9 on 1 and 8 DF,  p-value: 1.164e-06
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2021년 9월 24일 (금) 23:34 기준 최신판

함수 lm()

1 R[ | ]

x <- c(151, 174, 138, 186, 128, 136, 179, 163, 152, 131)
y <- c(63, 81, 56, 91, 47, 57, 76, 72, 62, 48)
relation <- lm(y~x)

print( relation )
# Call:
# lm(formula = y ~ x)
# 
# Coefficients:
# (Intercept)            x  
#    -38.4551       0.6746  

print( summary(relation) )
# Call:
# lm(formula = y ~ x)
# 
# Residuals:
#     Min      1Q  Median      3Q     Max 
# -6.3002 -1.6629  0.0412  1.8944  3.9775 
# 
# Coefficients:
#              Estimate Std. Error t value Pr(>|t|)    
# (Intercept) -38.45509    8.04901  -4.778  0.00139 ** 
# x             0.67461    0.05191  12.997 1.16e-06 ***
# ---
# Signif. codes:  
# 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# 
# Residual standard error: 3.253 on 8 degrees of freedom
# Multiple R-squared:  0.9548,	Adjusted R-squared:  0.9491 
# F-statistic: 168.9 on 1 and 8 DF,  p-value: 1.164e-06

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}