Dear all:

I am going to explain better the problem I have. I would greatly appreciate
an answer because I cannot advance further in my project while I do not
solve this problem.

I have a series of mean sea surface temperatures measured by satellites.

These data are reported in degrees longitude x degrees latitude. This means
that one measurement taken by a satellite for a squared degree in high
laltitudes represents a much smaller in area than another measurement taken
by the same satellite in an area of one  squared degree at the equator.

So, if I want to average several measurements from several places in the
world, I have to account for the fact that some measurements are
representative of greater areas, while others represent smaller areas.
That's why I have to weight the mean temperature from each
measurement/location by its area.

 For example:

The mean temperature (T1) off northern Norway is 8.7 ºC +/- 0.2, and
represents an area of 250 Km2
 The mean temperature (T2) off northern Iberia is 12.6 ºC +/- 0.4, and
represents an area of 319 Km2
 The mean temperature (T3) off equatorial Africa is 25.2 ºC +/- 0.3, and
represents an area of 630 Km2

I do not know the individual measurements that gave origin to the above
means, but I know that the number of individual measurements was the same
(let's pretend the satellite measured each area 10 times to produce those
means +/- sd).

So, If I want to know the average temperature in these three locations, I
need to weight each mean by the area it represents. Thus, the overall
weighted average temperature should be:

AvgT= (T1*A1 + T2*A2 + T3*A3)  /Total area

#R code

T <- c(8.7,12.6,25.2)
SD <- c(0.2,0.4,0.3)
A <- c(250,319,630)

AvgT <- ( T[1]*A[1] + T[2]*A[2] + T[3]*A[3]) / sum(A)

#so, AvgT  is 18.40734

Now, my question is how to average the SD. If I did not have to weight them
by the area, I thing I would have to apply the following formula:

AvgSD = sqrt( (SD1^2 +SD2^2 + SD3^2)/n)

 #R code

T <- c(8.7,12.6,25.2)
SD <- c(0.2,0.4,0.3)
A <- c(250,319,630)

AvgSD <- sqrt (( SD[1]^2 + SD[2]^2 + SD[3]^2) / 3)

#so, AvgSD would be 0.3109126

but I also have to weight each SD by its corresponding area in Km2, so the
above calculation is not accurate. The overall SD among the three measured
areas must be weighted by those areas that were measured.

Any idea of how to average SDs and including a weight for each one at the
same time?

Thank you,

Fernando Lima

On Sat, Jan 29, 2011 at 5:37 AM, Duncan Murdoch <murdoch.dun...@gmail.com>wrote:

> On 11-01-28 10:46 PM, Fernando Lima wrote:
>
>> Dear all,
>>
>> I have a problem that has been driving me nuts. I have searched everywhere
>> but could not find a comprehensive answer. I only get (sometimes
>> contradictory) bits of information.
>>
>> I have a series of measurements with associated standard deviations, e.g:
>>
>> means +/- sd
>> 10 +/- 0.2
>> 13 +/- 0.4
>> 09 +/- 0.3
>>
>> The number of observations used to estimate any of these means was the
>> same.
>> Let's say that each one resulted from 10 measurements.
>>
>> Also, I have another vector of weights. So, the first value should weight
>> 0.2, the second 0.1 and the third 0.7. The sum of weights is 1.
>>
>> weights
>> 0.2
>> 0.1
>> 0.7
>>
>> The weighted mean is easy:
>>
>> (10*0.2) + (13*0.1) + (9*0.7) = 9.6
>>
>> Now, for the weighted addition of SDs, I have no idea how to do it.
>>
>
> I think you need to give more details.  There are lots of ways to combine
> things using weights, but they don't all make sense in all contexts.  The
> "weighted addition of SDs" is not something that I recognize.
>
> If you give the formula for what it is you're trying to calculate, that
> would be easiest; if you don't know it, then a statement of what properties
> you'd like your solution to have might be enough.
>
> Duncan Murdoch
>
>
>> I've found functions such as wtd.var() from the package Hmisc for
>> calculating variances from values with different weights, but it does not
>> sum variances, it just calculates the overall variance of a set of
>> measurements with different weights.
>>
>>  I also found combinevar() from the package fishmethods that can be used
>> to
>> add variances, but this one does not allow to associate a weight to those
>> variances.
>>
>> So, I do not know how to do both things at the same time.
>>
>> Any idea? Any package? Or any suggestion so I can make my own function?
>>
>> Thank you very much
>>
>> Fernando Lima
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@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<http://www.r-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to