I use the onls
model package to calculate the orthogonal regression, use confit(model)
to calculate the confidence interval of the equation coefficients, the sample size is 50. But it prompts an error:
Error in approx(sp$y, sp$x, xout = cutoff): need at least two non-NA
values to interpolate.
I checked and there is no same x as the previous answer to this question, so what could be the reason? Or what else can I use to solve the confidence interval?
# Data
x<-c(52.37,52.91,53.15,55.18,55.25,56.95,57.17,57.86,60.93,63.55,65.25,65.73,68.39,70.39,70.65,72.19,73.33,75.98,76.88,79.58,79.83,80.57,82.68,83.75,87.48,98.35,101.86,103.69,104.42,104.69,106.84,107.01,108.61,109.97,111.32,112.89,113.81,115.97,119.46,120.24,120.40,145.92,145.90,153.39,167.93,171.33,172.33,195.90,209.02,226.68,244.34,291.43,328.42,360.37,457.47,576.96,749.65)
y<-c(218500,238600,395300,144900,526900,305100,229000,291600,327800,149200,239200,1500600,150400,222500,470800,347600,356400,375400,325100,151400,395800,367900,597000,391500,479700,349900,445200,521400,505400,573700,529700,317400,379700,829500,514900,706500,877400,500800,633800,529900,738800,917300,853700,734200,587700,991900,1324300,767200,1254300,902900,966300,2615300,1183600,1842500,2455700,4384800,5117400)
# Code
DAT <- data.frame(x, y)
model1 <-onls(y ~ a * x ^ b, data = DAT, start = list(a = 1,b = 1))
confint(model1, level = 0.95)
dput(head(sp, 20))
.FAILED: Only 40 out of 57 fitted points are orthogonal.