Tengo 2 preguntas.
1) ¿Cómo puedo tener la p.valor para mi 2 funciones? Mi hipótesis es que tengo una correlación entre mis funciones y mis datos.
2) ¿Cómo puedo tener un intervalos de confianza para mi 2 funciones?
library(ggplot2)
g <- function (x, a,b,c) a * (1-exp(-(x-c)/abs(b)))
X1 <- c(129.08,109.92,85.83,37.72)
Y1 <- c(0.7,0.5,0.39,-1.36)
dt1 <- data.frame(x1=X1,y1=Y1)
model1 <- nls(Y1 ~ g(X1, a, b, c),
start = list(a=0.5, b=60, c=50),control=nls.control(maxiter = 200))
ggplot(data = dt1,aes(x = x1, y = y1)) +
theme_bw() + geom_point() +
geom_smooth(data=dt1, method="nls", formula=y~g(x, a, b, c),
se=F, start=list(a=0.5, b=60, c=50))
f <- function (x, a, b, c) a*(x^2)+b*x+c
X2 <- c(589.62,457.92,370.16,295.98,243.99,199.07,159.91,142.63,
124.15, 101.98, 87.93, 83.16, 82.2, 74.48, 47.68, 37.51, 31,
27.9, 21.24,18.28)
Y2 <- c(0.22,0.37,0.49,0.65,0.81,0.83,1,0.81,0.65,0.44,0.55,0.63,
0.65,0.55,0.37,0.32,0.27,0.22,0.17,0.14)
dt2 <- data.frame(x2=X2,y2=Y2)
model2 <- nls(Y2 ~ f(X2, a, b, c),
start = list(a=-1, b=3, c=0),control=nls.control(maxiter = 200))
ggplot(data = dt2,aes(x = x2, y = y2)) +
theme_bw() + geom_point() +
geom_smooth(data=dt2, method="nls", formula=y~f(x, a, b, c),
se=F, start=list(a=-1, b=3, c=0))
Gracias de antemano