James Allsopp
2009-May-07 14:19 UTC
[R] Linear least squares fit with errors in both x and y values.
HI, I'd like to perform a weighted linear least squares fit with R on data with varying errors on both vectors. I can do this with one axis using lm, but have no idea where to go from here. I've tried googling, but no idea. Any suggestions? Thanks, James
James Allsopp
2009-May-07 15:08 UTC
[R] Linear least squares fit with errors in both x and y values.
Hi, I'd like to perform a weighted linear least squares fit with R on data with varying errors on both vectors. I can do this with one axis using lm, but have no idea where to go from here. I've tried googling, but no idea. Any suggestions? I'm also trying to plot these errors on a graph. Again I can see how to do it for one set of data but not the other. Thanks, James
Gerard M. Keogh
2009-May-07 16:12 UTC
[R] Linear least squares fit with errors in both x and y values.
James, look up "errors in variables" models or "instrumental variable" models in econometrics. The statistics alternative is a "random effects" or "mixed effects" model which plugs the variation in the x's into a randomly varying parameter - these are available in R (?lmer or glmm - I think). Someone on the list much more knowledgeable than I about these will be able to give you some help if you ask a good question. Gerard James Allsopp <jamesaallsopp at go oglemail.com> To Sent by: r-help at r-project.org r-help-bounces at r- cc project.org Subject [R] Linear least squares fit with 07/05/2009 15:19 errors in both x and y values. HI, I'd like to perform a weighted linear least squares fit with R on data with varying errors on both vectors. I can do this with one axis using lm, but have no idea where to go from here. I've tried googling, but no idea. Any suggestions? Thanks, James ______________________________________________ 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. ********************************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. It is the policy of the Department of Justice, Equality and Law Reform and the Agencies and Offices using its IT services to disallow the sending of offensive material. Should you consider that the material contained in this message is offensive you should contact the sender immediately and also mailminder[at]justice.ie. Is le haghaidh an duine n? an eintitis ar a bhfuil s? d?rithe, agus le haghaidh an duine n? an eintitis sin amh?in, a bhearta?tear an fhaisn?is a tarchuireadh agus f?adfaidh s? go bhfuil ?bhar faoi r?n agus/n? faoi phribhl?id inti. Toirmisctear aon athbhreithni?, atarchur n? leathadh a dh?anamh ar an bhfaisn?is seo, aon ?s?id eile a bhaint aisti n? aon ghn?omh a dh?anamh ar a hiontaoibh, ag daoine n? ag eintitis seachas an faighteoir beartaithe. M? fuair t? ? seo tr? dhearmad, t?igh i dteagmh?il leis an seolt?ir, le do thoil, agus scrios an t-?bhar as aon r?omhaire. Is ? beartas na Roinne Dl? agus Cirt, Comhionannais agus Athch?irithe Dl?, agus na nOif?g? agus na nGn?omhaireachta? a ?s?ideann seirbh?s? TF na Roinne, seoladh ?bhair chol?il a dh?chead?. M?s rud ? go measann t? gur ?bhar col?il at? san ?bhar at? sa teachtaireacht seo is ceart duit dul i dteagmh?il leis an seolt?ir l?ithreach agus le mailminder[ag]justice.ie chomh maith. ***********************************************************************************