Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > # Input data
- > head(my_df)
- Y X
- [1,] -0.39643897 0.014797410
- [2,] -1.11042940 -1.634525956
- [3,] -0.02086076 -0.340575102
- [4,] 1.90382401 0.117504381
- [5,] 0.62557591 1.042435648
- [6,] -1.40269719 -0.006455178
- > dimmy_df
- dim dim.data.frame dim<- dimnames dimnames.data.frame dimnames<- dimnames<-.data.frame
- > dim(my_df)
- [1] 50 2
- ######
- > lm(data=my_df, " Y ~ X ")
- Call:
- lm(formula = " Y ~ X ", data = my_df)
- Coefficients:
- (Intercept) X
- -1.076e-17 5.600e-01
- > model = lm(data=my_df, " Y ~ X ")
- > summary(model)
- Call:
- lm(formula = " Y ~ X ", data = my_df)
- Residuals:
- Min 1Q Median 3Q Max
- -1.65443 -0.57053 -0.06958 0.47720 1.83802
- Coefficients:
- Estimate Std. Error t value Pr(>|t|)
- (Intercept) -1.076e-17 1.184e-01 0.000 1
- X 5.600e-01 1.196e-01 4.683 2.35e-05 ***
- ---
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- Residual standard error: 0.8371 on 48 degrees of freedom
- Multiple R-squared: 0.3136, Adjusted R-squared: 0.2993
- F-statistic: 21.93 on 1 and 48 DF, p-value: 2.352e-05
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement