[R] distance from fitted line

eliza botto eliza_botto at hotmail.com
Mon Oct 20 12:00:11 CEST 2014


Thankyou very much Joachim. Actually I already know the residual() command. I only wanted to know that is there a way to account for the fitted lines? its more of a criosity rather than a problem. 
:)
Thankyou very much once again.

Eliza

To: eliza_botto at hotmail.com
Subject: Re: [R] distance from fitted line
From: Joachim.Audenaert at pcsierteelt.be
Date: Mon, 20 Oct 2014 11:11:21 +0200

Hello Eliza,



I'm quite new to R, but I use the residuals
function to calculate the distance from my data points to the fitted line
of my nls (non linear least squares model).



residuals(name of your fitted model)



I would check for a model that fits
your datapoints and then calculate the residuals of the model to your data.
Why do you fit the generalized Extreme Value distribution
to your points in stead
of a regression model?



Met vriendelijke groeten/Kind Regards,



Joachim Audenaert 

onderzoeker gewasbescherming



PCS |
proefcentrum voor sierteelt




Schaessestraat 18, 9070
Destelbergen, België

T: +32 (0)9 353 94 71 | F: +32 (0)9 353 94 95

E: joachim.audenaert at pcsierteelt.be
| W: www.pcsierteelt.be



>> KEN JIJ DE
8 BASISPRINCIPES VAN IPM? MEER INFO OP WWW.PCSIERTEELT.BE
    






From:      
 eliza botto <eliza_botto at hotmail.com>

To:      
 "r-help at r-project.org"
<r-help at r-project.org>

Date:      
 19/10/2014 22:08

Subject:    
   [R] distance
from fitted line

Sent by:    
   r-help-bounces at r-project.org









Dear useRs,

I have the following dataset.

> dput(EB)

c(77.724, 76.708, 84.836, 85.09, 118.11, 65.024, 121.412, 63.5, 102.87,
81.3, 108.7, 110.7, 71.9, 42.2, 101, 151.4, 94, 112, 48, 73.4, 76.6, 62.2,
59.4, 114.3, 214.3, 110.5, 46, 84.7, 128.1, 45.2, 109.5, 102.3, 77.5, 61,
97.3, 78, 142, 88.2, 54, 91.4, 54.1, 96, 143.3, 153.7, 101.5, 95.8, 101,
131, 140, 189.4)

I fitted generalized Extreme Value distribution on it by using following
codes

library(nsRFA)

q=EB

lmom=Lmoments(q)

pr = par.GEV (lambda1=lmom["l1"], lambda2=lmom["l2"],
tau3=lmom["lca"])

RP = c(1.01,2, 10, 20, 50, 100, 200, 500)

quant = invF.GEV (1-1/RP, pr$xi, pr$alfa, pr$k)

qs = sort(q)

pp = 1:length(qs)/(length(qs)+1)

RPpp = 1/(1-pp)

plot(RP, quant, type="l", log="x",col="black",ylim=c(0,500),xlim=c(0.1,500))

points(RPpp, qs)

What I want to do now is to calculate the distance of all the points from
the "fitted line" and ultimately calculating RMSE of the data.

Is there a way of doing it?



Thankyou very much in advance



Eliza                  
               
                 
                 
               
     

                
[[alternative HTML version deleted]]



______________________________________________

R-help at r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help

PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.







PCS-proeven
leiden tot nieuwe erkenningen in de sierteelt
| Het
PCS op LinkedIn

Disclaimer\ | Please consider the environment before pri...{{dropped:6}}



More information about the R-help mailing list