Hello, and please excuse this off-topic question, but I have not been able to find an answer elsewhere. Consider a value Z that is calculated using the product (or ratio) of two means X_mean and Y_mean: Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard error of Z will be a function of the standard errors of the means of X and Y. I want to calculate this se of Z. Can someone direct me to a reference (text book or other) that gives the solution to this *general* problem? Thanks. Bill Shipley [[alternative HTML version deleted]]
You could try googling for "delta method". I believe MASS even has code for that... Andy> From: Bill Shipley > > Hello, and please excuse this off-topic question, but I have not been > able to find an answer elsewhere. Consider a value Z that is > calculated > using the product (or ratio) of two means X_mean and Y_mean: > Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard > error of Z will be a function of the standard errors of the means of X > and Y. I want to calculate this se of Z. Can someone direct me to a > reference (text book or other) that gives the solution to > this *general* > problem? > > Thanks. > > > > Bill Shipley > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
I know two standard ways to approach this. The traditional approximation is called the "delta method"; it uses a Taylor series approximation, usually of first order but could be higher. Googling for "delta method" produced several useful hits just now. The second method is Monte Carlo. hope this helps. spencer graves Bill Shipley wrote:>Hello, and please excuse this off-topic question, but I have not been >able to find an answer elsewhere. Consider a value Z that is calculated >using the product (or ratio) of two means X_mean and Y_mean: >Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard >error of Z will be a function of the standard errors of the means of X >and Y. I want to calculate this se of Z. Can someone direct me to a >reference (text book or other) that gives the solution to this *general* >problem? > >Thanks. > > > >Bill Shipley > > > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >
Hi, Andy: MASS4 has section 5.7 "Bootstrap and Permutation Methods". Is this what you are suggesting? It certainly is relevant to the question (but not to the "delta method", except as a means of checking on it). Thanks, spencer graves Liaw, Andy wrote:>You could try googling for "delta method". I believe MASS even has code for >that... > >Andy > > > >>From: Bill Shipley >> >>Hello, and please excuse this off-topic question, but I have not been >>able to find an answer elsewhere. Consider a value Z that is >>calculated >>using the product (or ratio) of two means X_mean and Y_mean: >>Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard >>error of Z will be a function of the standard errors of the means of X >>and Y. I want to calculate this se of Z. Can someone direct me to a >>reference (text book or other) that gives the solution to >>this *general* >>problem? >> >>Thanks. >> >> >> >>Bill Shipley >> >> >> >> >> [[alternative HTML version deleted]] >> >>______________________________________________ >>R-help at stat.math.ethz.ch mailing list >>https://stat.ethz.ch/mailman/listinfo/r-help >>PLEASE do read the posting guide! >>http://www.R-project.org/posting-guide.html >> >> >> >> > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >
What I have in mind is the discussion on pp. 167-172 of `S Programming'. Cheers, Andy> From: Spencer Graves > > Hi, Andy: > > MASS4 has section 5.7 "Bootstrap and Permutation Methods". Is > this what you are suggesting? It certainly is relevant to > the question > (but not to the "delta method", except as a means of checking on it). > > Thanks, > spencer graves > > Liaw, Andy wrote: > > >You could try googling for "delta method". I believe MASS > even has code for > >that... > > > >Andy > > > > > > > >>From: Bill Shipley > >> > >>Hello, and please excuse this off-topic question, but I > have not been > >>able to find an answer elsewhere. Consider a value Z that is > >>calculated > >>using the product (or ratio) of two means X_mean and Y_mean: > >>Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard > >>error of Z will be a function of the standard errors of the > means of X > >>and Y. I want to calculate this se of Z. Can someone > direct me to a > >>reference (text book or other) that gives the solution to > >>this *general* > >>problem? > >> > >>Thanks. > >> > >> > >> > >>Bill Shipley > >> > >> > >> > >> > >> [[alternative HTML version deleted]] > >> > >>______________________________________________ > >>R-help at stat.math.ethz.ch mailing list > >>https://stat.ethz.ch/mailman/listinfo/r-help > >>PLEASE do read the posting guide! > >>http://www.R-project.org/posting-guide.html > >> > >> > >> > >> > > > >______________________________________________ > >R-help at stat.math.ethz.ch mailing list > >https://stat.ethz.ch/mailman/listinfo/r-help > >PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > > > > > > >
Kjetil Brinchmann Halvorsen
2005-Jan-05 23:18 UTC
[R] variance of combinations of means - off topic
Liaw, Andy wrote:>You could try googling for "delta method". I believe MASS even has code for >that... > >Andy > > >If you have the original data you can bootstrap --- else you need the standar errors and correlation between the means, and can use the delta methos as above. You could even use D or deriv or deriv3 to get the derivatives automatically. We learnt this (the delta method) in physics class in high school, to be able to write the lab reports. Kjetil>>From: Bill Shipley >> >>Hello, and please excuse this off-topic question, but I have not been >>able to find an answer elsewhere. Consider a value Z that is >>calculated >>using the product (or ratio) of two means X_mean and Y_mean: >>Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard >>error of Z will be a function of the standard errors of the means of X >>and Y. I want to calculate this se of Z. Can someone direct me to a >>reference (text book or other) that gives the solution to >>this *general* >>problem? >> >>Thanks. >> >> >> >>Bill Shipley >> >> >> >> >> [[alternative HTML version deleted]] >> >>______________________________________________ >>R-help at stat.math.ethz.ch mailing list >>https://stat.ethz.ch/mailman/listinfo/r-help >>PLEASE do read the posting guide! >>http://www.R-project.org/posting-guide.html >> >> >> >> > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > > > >-- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
Kjetil Brinchmann Halvorsen
2005-Jan-06 00:41 UTC
[R] variance of combinations of means - off topic
Liaw, Andy wrote:>You could try googling for "delta method". I believe MASS even has code for >that... > >Andy > > >also, help.search("delta") does give nothing usefull, so if it is in MASS it would be hidden, and need a \concept entry in the .Rd file. The delta method is really nothimg more (or less) than a linear Taylor approximation. The following is a very fast implementation, which surely can be bettered: se.delta <- function(expr, namevec, theta, sigma) { # theta is means, or more generally, estimates, # sigma is vector or matrix containing (standard errors)^2 and (if matrix) # covariances. If vector must be same length as theta, and we assume no # correlation between estimates theta. # expr must be a formula defining a function # taking as many arguments as length of theta. # namevec is a character vector containing the symbols used in the formula. p <- length(theta) if (!is.matrix(sigma)) sigma <- diag(sigma) if(!(NROW(sigma)==p)) stop("sigma and theta must have appropiate dimension") fun <- deriv(expr, namevec, TRUE) derivs <- do.call("fun", as.list(theta)) derivs <- as.vector(attr(derivs, "gradient")) vartheta <- derivs %*% sigma %*% derivs setheta <- sqrt(vartheta) setheta } example: se.delta(~ x^2 + y^2, c("x", "y"), c(0.5, 1), c(0.001, 0.001)) [,1] [1,] 0.07071068 (there must be possible to calculate the namevec argument from the formula argument, but I have no time for that now) Kjetil>>From: Bill Shipley >> >>Hello, and please excuse this off-topic question, but I have not been >>able to find an answer elsewhere. Consider a value Z that is >>calculated >>using the product (or ratio) of two means X_mean and Y_mean: >>Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard >>error of Z will be a function of the standard errors of the means of X >>and Y. I want to calculate this se of Z. Can someone direct me to a >>reference (text book or other) that gives the solution to >>this *general* >>problem? >> >>Thanks. >> >> >> >>Bill Shipley >> >> >> >> >> [[alternative HTML version deleted]] >> >>______________________________________________ >>R-help at stat.math.ethz.ch mailing list >>https://stat.ethz.ch/mailman/listinfo/r-help >>PLEASE do read the posting guide! >>http://www.R-project.org/posting-guide.html >> >> >> >> > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > > > >-- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
Bill, P. 146 of Casella and Berger's "Statistical Inference" 1990 starts a section on bivariate transformations. Andrew -- Andrew Robinson Ph: 208 885 7115 Department of Forest Resources Fa: 208 885 6226 University of Idaho E : andrewr at uidaho.edu PO Box 441133 W : http://www.uidaho.edu/~andrewr Moscow ID 83843 Or: http://www.biometrics.uidaho.edu No statement above necessarily represents my employer's opinion.
On Wed, 5 Jan 2005, Kjetil Brinchmann Halvorsen wrote:> Liaw, Andy wrote: > >> You could try googling for "delta method". I believe MASS even has code >> for >> that...I believe you are thinking of an example in S Programming, which does automatic differentiation and the delta method. -thomas
Bill Shipley wrote:> Hello, and please excuse this off-topic question, but I have not been > able to find an answer elsewhere. Consider a value Z that is calculated > using the product (or ratio) of two means X_mean and Y_mean: > Z=X_mean*Y_mean. More generally, Z=f(X_mean, Y_mean). The standard > error of Z will be a function of the standard errors of the means of X > and Y. I want to calculate this se of Z. Can someone direct me to a > reference (text book or other) that gives the solution to this *general* > problem? >Kendall's Advanced Theory of statistics (sect. 10.6, p. 324 in the 5th edition) provides an approximate expression for the variance of a ratio (based on the delta method already mentioned). Sect. 11.9 and following provides a general discussion of the distribution of a ratio, and some special cases (F-ratio, ratio of standard normals). Kent -- Kent E. Holsinger kent at darwin.eeb.uconn.edu http://darwin.eeb.uconn.edu -- Department of Ecology & Evolutionary Biology -- University of Connecticut, U-3043 -- Storrs, CT 06269-3043
Of course, the delta method is terrible when the first derivative is small relative to the curvature. In that case, you either need to consider bootstrap, Monte Carlo, permutation testing, as suggested by Venables and Ripley in MASS and S Programming, or possibly using a higher order Taylor series expansion. spencer graves Thomas Lumley wrote:> On Wed, 5 Jan 2005, Kjetil Brinchmann Halvorsen wrote: > >> Liaw, Andy wrote: >> >>> You could try googling for "delta method". I believe MASS even has >>> code for >>> that... >> > > I believe you are thinking of an example in S Programming, which does > automatic differentiation and the delta method. > > -thomas > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html