setwd("~/Google Drive/Nuevo_perro/data/final_juan/output")
datos<-read.table("testa.csv", header=T, sep=',')
attach(datos)
library(smatr)
fit3<-sma(muestra~total)
fit3
## Call: sma(formula = muestra ~ total)
##
## Fit using Standardized Major Axis
##
## ------------------------------------------------------------
## Coefficients:
## elevation slope
## estimate 0.006070267 1.1641232
## lower limit -0.024725420 0.8453773
## upper limit 0.036865953 1.6030509
##
## H0 : variables uncorrelated
## R-squared : 0.8938742
## P-value : 0.00038941
slope.test(muestra, total, test.value = 1, data=NULL, method = 1,
alpha = 0.05, V = matrix(0,2,2), intercept = TRUE, robust=FALSE)
## $F
## [1] 1.315759
##
## $r
## [1] 0.4240904
##
## $p
## [1] 0.2950285
##
## $test.value
## [1] 1
##
## $b
## [1] 1.164123
##
## $ci
## [,1] [,2]
## [1,] 0.8453773 1.603051
plot(fit3, lty=2)
plot(fit3, add = T, abline(coef = c(0,1)), lty = 2)

detach(datos)
datos2<-read.table("almendra.csv", header=T, sep=',')
attach(datos2)
fit4<-sma(muestra~total)
fit4
## Call: sma(formula = muestra ~ total)
##
## Fit using Standardized Major Axis
##
## ------------------------------------------------------------
## Coefficients:
## elevation slope
## estimate -0.012664704 1.743171
## lower limit -0.033955233 1.550944
## upper limit 0.008625825 1.959222
##
## H0 : variables uncorrelated
## R-squared : 0.9862568
## P-value : 8.1539e-07
slope.test(muestra, total, test.value = 1, data=NULL, method = 1,
alpha = 0.05, V = matrix(0,2,2), intercept = TRUE, robust=FALSE)
## $F
## [1] 149.2817
##
## $r
## [1] 0.98049
##
## $p
## [1] 1.829525e-05
##
## $test.value
## [1] 1
##
## $b
## [1] 1.743171
##
## $ci
## [,1] [,2]
## [1,] 1.550944 1.959222
plot(fit4, lty=2)
plot(fit4, add = T, abline(coef = c(0,1)), lty = 2)
