datos=c(6,3,7,4,5,3)
A=matrix(data=datos,nrow=3,ncol=2,byrow=FALSE)
print(A*3)
##      [,1] [,2]
## [1,]   18   12
## [2,]    9   15
## [3,]   21    9
matA<-matrix(data=c("a","b","c","d","e","f"),nrow=3,ncol=2,byrow=TRUE)
rownames(matA)<-c("Fila1","Fila2","Fila3")
colnames(matA)<-c("Col1","Col2")
print(matA)
##       Col1 Col2
## Fila1 "a"  "b" 
## Fila2 "c"  "d" 
## Fila3 "e"  "f"
class(matA)
## [1] "matrix" "array"
print(is.matrix(matA))
## [1] TRUE

Fórmulas estadísticas

x<-c(4,2,7,8,4,6,5,8,3)
media<-mean(x)
desvSTD<-sd(x)
varianza<-var(x)
print(media)
## [1] 5.222222
print(desvSTD)
## [1] 2.166667
print(varianza)
## [1] 4.694444
x<-c(0,1,2,3,4,5)
y<-c(2.5,1.4,1.98,3.1,3.8,5.4)
formula1<-formula(y~x)
modelo<-lm(formula1)
summary(modelo)
## 
## Call:
## lm(formula = formula1)
## 
## Residuals:
##      1      2      3      4      5      6 
##  1.100 -0.652 -0.724 -0.256 -0.208  0.740 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)   1.4000     0.6072   2.306   0.0824 .
## x             0.6520     0.2006   3.251   0.0313 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.839 on 4 degrees of freedom
## Multiple R-squared:  0.7254, Adjusted R-squared:  0.6568 
## F-statistic: 10.57 on 1 and 4 DF,  p-value: 0.03135
plot(x,y)
abline(0.35238,0.93771,col="blue")

altura<-c(2.25,2.00,1.80,1.70,1.50,1.25)
tiempo<-c(0.729,0.690,0.623,0.607,0.553,0.503)
h<-seq(1.0,2.50,0.1)
tiempoCalc<-sqrt(h*2/9.8)

t2=tiempo*tiempo


plot(t2,altura,xlim=c(0.4,0.90),ylim=c(0,3.0),main="Altura(cm)vsTiempo(s)",xlab="t(seg)",ylab="altura(cm)")
lines(tiempoCalc,h,col="green")
abline(-0.8785,4.2723,col="violet")
abline(v=0.7,col="pink")
abline(h=2.0,col="green")
abline(v=0.5,col="blue")

modelo<-lm(altura~tiempo)
summary(modelo)
## 
## Call:
## lm(formula = altura ~ tiempo)
## 
## Residuals:
##         1         2         3         4         5         6 
##  0.029692 -0.055806  0.026801 -0.005711  0.022062 -0.017038 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -0.8546     0.1234  -6.925  0.00228 ** 
## tiempo        4.2180     0.1984  21.265 2.89e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03716 on 4 degrees of freedom
## Multiple R-squared:  0.9912, Adjusted R-squared:  0.989 
## F-statistic: 452.2 on 1 and 4 DF,  p-value: 2.891e-05

Linealizado altura vs \(t^2\)

altura<-c(2.25,2.00,1.80,1.70,1.60,1.50,1.25)
tiempo<-c(0.729,0.690,0.623,0.607,0.586,0.553,0.503)
h<-seq(1.0,2.50,0.1)
t<-sqrt(h*2/9.8)

t2=tiempo*tiempo

plot(t2,altura,main="Altura(cm) vs Tiempo(s)")
abline(0.4698,3.3319)

modelo<-lm(altura~t2)
summary(modelo)
## 
## Call:
## lm(formula = altura ~ t2)
## 
## Residuals:
##          1          2          3          4          5          6          7 
##  0.0088906 -0.0526873  0.0468317  0.0138371 -0.0008638  0.0271105 -0.0431189 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.43169    0.06582   6.559  0.00124 ** 
## t2           3.40475    0.16828  20.233 5.45e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03958 on 5 degrees of freedom
## Multiple R-squared:  0.9879, Adjusted R-squared:  0.9855 
## F-statistic: 409.4 on 1 and 5 DF,  p-value: 5.454e-06

\(\sigma\)

\(\alpha^{3x}\)

\(\int{\frac{3a}{1-x}}\)

\(\sqrt{9x^2}\)