"आर (प्रोग्रॅमिंग भाषा)" च्या विविध आवृत्यांमधील फरक
Content deleted Content added
नवीन पान: thumb|आर आर ही सांख्यिकीय गणन आणि आलेख यां... |
छो →उदाहरणे |
||
ओळ ३१:
== उदाहरणे ==
<source lang="rsplus">
> x <- c(1,2,3,4,5,6) # Create ordered collection (vector)
> y <- x^2 # Square the elements of x
Line ४२ ⟶ ४३:
# store the results as lm_1
> print(lm_1) # Print the model from the (linear model object) lm_1
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
-9.333 7.000
> summary(lm_1) # Compute and print statistics for the fit
# of the (linear model object) lm_1
Call:
lm(formula = y ~ x)
Residuals:
1 2 3 4 5 6
3.3333 -0.6667 -2.6667 -2.6667 -0.6667 3.3333
Coefficients:
Estimate Std. Error t value Pr(>|t|)
Line ६६ ⟶ ६७:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.055 on 4 degrees of freedom
Multiple R-squared: 0.9583,
F-statistic: 91.88 on 1 and 4 DF, p-value: 0.000662
> par(mfrow=c(2, 2)) # Request 2x2 plot layout
> plot(lm_1) # Diagnostic plot of regression model
</source>
[[चित्र:Plots_from_lm_example.svg.png|thumb|वरील आज्ञावलीने मिळालेले परिणाम]]
|