You are on page 1of 8

R version 3.4.

3 (2017-11-30) -- "Kite-Eating Tree"


Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.


You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.


Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or


'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> LOG(5)}
Error: unexpected '}' in "LOG(5)}"
> LOG(5)
Error in LOG(5) : could not find function "LOG"
> i<-5
> i
[1] 5
> (e<-2)
[1] 2
> e+i
[1] 7
> e-i
[1] -3
> e*i
[1] 10
> o=e+i
> 0
[1] 0
> o
[1] 7
> u<-e^i
> u
[1] 32
> a<-c(1,2,3)
> a
[1] 1 2 3
> d<-(4,5,6)
Error: unexpected ',' in "d<-(4,"
> d
Error: object 'd' not found
> d<-c(4,5,6)
> d
[1] 4 5 6
> d+a
[1] 5 7 9
> max(a)
[1] 3
> min(a)
[1] 1
> max(d)
[1] 6
> min(d)
[1] 4
> max(a)-min(d)
[1] -1
> max(d)-min(a)
[1] 5
> sort(a)
[1] 1 2 3
> h(9,8,7,6,5,4,3,2,1)
Error in h(9, 8, 7, 6, 5, 4, 3, 2, 1) : could not find function "h"
> h<-c(9,8,7,6,5,4,3,2,1))
Error: unexpected ')' in "h<-c(9,8,7,6,5,4,3,2,1))"
> h<-c(9,8,7,6,5,4,3,2,1)
> h
[1] 9 8 7 6 5 4 3 2 1
> sort(h)
[1] 1 2 3 4 5 6 7 8 9
> length(h)
[1] 9
> sum(h)
[1] 45
> prod(h)
[1] 362880
> summary(h)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1 3 5 5 7 9
> min(h)
[1] 1
> mean(h)
[1] 5
> sd(h)
[1] 2.738613
> var<-=sd(h)^2
Error: unexpected '=' in "var<-="
> var=sd(h)^2
> var
[1] 7.5
> var(h)
[1] 7.5
> table(h)
h
1 2 3 4 5 6 7 8 9
1 1 1 1 1 1 1 1 1
> hist(h)
> numeric(10)
[1] 0 0 0 0 0 0 0 0 0 0
> numeric(20)
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> numeric(22)
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> sd(h)
[1] 2.738613
> rep(1,20)
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> rep(2,20)
[1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
> w<-numeric(20)
> w
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> seq(50)
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[20] 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
[39] 39 40 41 42 43 44 45 46 47 48 49 50
> seq(4,20,2)
[1] 4 6 8 10 12 14 16 18 20
> 5:15
[1] 5 6 7 8 9 10 11 12 13 14 15
> 0==1
[1] FALSE
> 0<1
[1] TRUE
> 1==1
[1] TRUE
> 5==4
[1] FALSE
> (r<-c(7,2,6,9,4,1,3))
[1] 7 2 6 9 4 1 3
> (w<-r<3|r>=6)
[1] TRUE TRUE TRUE TRUE FALSE TRUE FALSE
> milista<-list(A=seq(8,36,4),this="that",idm=diag(3))
> milista
$A
[1] 8 12 16 20 24 28 32 36

$this
[1] "that"

$idm
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1

> names(milista)
[1] "A" "this" "idm"
> milista$A
[1] 8 12 16 20 24 28 32 36
> A<-matrix(c(2,-4,-1,5,7,0),nrow = 2)
> A
[,1] [,2] [,3]
[1,] 2 -1 7
[2,] -4 5 0
> B<-matrix(c(2,1,0,3,-1,-5),nrow = 2)
> B
[,1] [,2] [,3]
[1,] 2 0 -1
[2,] 1 3 -5
> A+B
[,1] [,2] [,3]
[1,] 4 -1 6
[2,] -3 8 -5
> A-B
[,1] [,2] [,3]
[1,] 0 -1 8
[2,] -5 2 5
> A*B
[,1] [,2] [,3]
[1,] 4 0 -7
[2,] -4 15 0
> A/B
[,1] [,2] [,3]
[1,] 1 -Inf -7
[2,] -4 1.666667 0
> library(readxl)
> DATTOS <- read_excel("DATTOS.xlsx")
> View(DATTOS)
> DATTOS
# A tibble: 10 x 3
OBS Y C
<dbl> <dbl> <dbl>
1 1. 40. 10.
2 2. 42. 15.
3 3. 48. 22.
4 4. 56. 24.
5 5. 50. 30.
6 6. 58. 32.
7 7. 60. 38.
8 8. 69. 40.
9 9. 72. 45.
10 10. 84. 49.
> plot(Y,C)
Error in plot(Y, C) : object 'Y' not found
> Y
Error: object 'Y' not found
> (Y<-c(40,42,48,46,50,58,60,69,72,84))
[1] 40 42 48 46 50 58 60 69 72 84
> (C<-c(10,15,22,24,30,32,38,40,45,49))
[1] 10 15 22 24 30 32 38 40 45 49
> plot(Y,C)
> cor(Y,C)
[1] 0.9546402
> R=cor(Y,C)
> R
[1] 0.9546402
> R^2
[1] 0.9113379
> library(stats)
> install.packages("car")
Installing package into ‘C:/Users/Viviana/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘minqa’, ‘nloptr’, ‘RcppEigen’, ‘lme4’,
‘SparseM’, ‘MatrixModels’, ‘pbkrtest’, ‘quantreg’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/minqa_1.2.4.


zip'
Content type 'application/zip' length 666352 bytes (650 KB)
downloaded 650 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/nloptr_1.0.4


.zip'
Content type 'application/zip' length 1173005 bytes (1.1 MB)
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/RcppEigen_0.


3.3.4.0.zip'
Content type 'application/zip' length 2663532 bytes (2.5 MB)
downloaded 2.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/lme4_1.1-15.


zip'
Content type 'application/zip' length 4741394 bytes (4.5 MB)
downloaded 4.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/SparseM_1.77


.zip'
Content type 'application/zip' length 968526 bytes (945 KB)
downloaded 945 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/MatrixModels


_0.4-1.zip'
Content type 'application/zip' length 202845 bytes (198 KB)
downloaded 198 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/pbkrtest_0.4


-7.zip'
Content type 'application/zip' length 196292 bytes (191 KB)
downloaded 191 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/quantreg_5.3


5.zip'
Content type 'application/zip' length 2130200 bytes (2.0 MB)
downloaded 2.0 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/car_2.1-6.zi


p'
Content type 'application/zip' length 1597958 bytes (1.5 MB)
downloaded 1.5 MB

package ‘minqa’ successfully unpacked and MD5 sums checked


Error in install.packages : cannot open file 'C:/Users/Viviana/Documents/
R/win-library/3.4/file2dc025cc2f2a/nloptr/doc/nloptr.pdf': Permission den
ied
>
> install.packages("lmtest")
Installing package into ‘C:/Users/Viviana/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘zoo’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/zoo_1.8-1.zi


p'
Content type 'application/zip' length 915765 bytes (894 KB)
downloaded 894 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/lmtest_0.9-3


5.zip'
Content type 'application/zip' length 289242 bytes (282 KB)
downloaded 282 KB

Error in install.packages : cannot open file 'C:/Users/Viviana/Documents/


R/win-library/3.4/file2dc0e7f7ca8/zoo/doc/zoo-design.pdf': Permission den
ied
> install.packages("zoo")
Installing package into ‘C:/Users/Viviana/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/zoo_1.8-1.zi
p'
Content type 'application/zip' length 915765 bytes (894 KB)
downloaded 894 KB

Error in install.packages : cannot open file 'C:/Users/Viviana/Documents/


R/win-library/3.4/file2dc02a421ab/zoo/doc/zoo-design.pdf': Permission den
ied
> install.packages("car")
Installing package into ‘C:/Users/Viviana/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘nloptr’, ‘RcppEigen’, ‘lme4’, ‘SparseM’
, ‘MatrixModels’, ‘pbkrtest’, ‘quantreg’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/nloptr_1.0.4


.zip'
Content type 'application/zip' length 1173005 bytes (1.1 MB)
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/RcppEigen_0.


3.3.4.0.zip'
Content type 'application/zip' length 2663532 bytes (2.5 MB)
downloaded 2.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/lme4_1.1-15.


zip'
Content type 'application/zip' length 4741394 bytes (4.5 MB)
downloaded 4.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/SparseM_1.77


.zip'
Content type 'application/zip' length 968526 bytes (945 KB)
downloaded 945 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/MatrixModels


_0.4-1.zip'
Content type 'application/zip' length 202845 bytes (198 KB)
downloaded 198 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/pbkrtest_0.4


-7.zip'
Content type 'application/zip' length 196292 bytes (191 KB)
downloaded 191 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/quantreg_5.3


5.zip'
Content type 'application/zip' length 2130200 bytes (2.0 MB)
downloaded 2.0 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/car_2.1-6.zi


p'
Content type 'application/zip' length 1597958 bytes (1.5 MB)
downloaded 1.5 MB

Error in install.packages : cannot open file 'C:/Users/Viviana/Documents/


R/win-library/3.4/file2dc021f47598/nloptr/doc/nloptr.pdf': Permission den
ied
> library(lmtest)
Error in library(lmtest) : there is no package called ‘lmtest’
> reg1<-lm(log(C))~log(Y),DATTOS)
Error: unexpected ',' in "reg1<-lm(log(C))~log(Y),"
> reg1<-lm(log(C)~log(Y),DATTOS)
> coef(summary(reg1))
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.627734 1.1587028 -3.993892 0.0039835967
lo

clase 6/03/2018

datos de la regresion

VARIANZA DE LOS ERRORES


sig_u<-as.numeric(t(ugorro)%*%ugorro/(nobs(reg1)-2-1))

ERROR ESTÁNDAR DE LOS RESIDUOS


(ser<-sqrt(sig_u))
Toma el objeto y le saca la raíz

HISTOGRAMA
z<-residuals(model1)
Error in residuals(model1) : object 'model1' not found
> plot(z)
Error in plot(z) : object 'z' not found
> View(reg1)
> z<-residuals(reg1)
> plot(z)
> histogram(z)
Error in histogram(z) : could not find function "histogram"
> hist(z)

GASTO EN CANATS FAMILIAR 700

POSEEER TRABAJO 1

Tener # hijos 4

You might also like