New Posts
  • Hi there guest! Welcome to PoliticalJack.com. Register for free to join our community?

Stats Question

Arkady

President
For anyone who knows stats: is there a term for a weighted best-fit trend line? What I'm picturing is plotting one variable against another for a set of items, plotting a trend line for that collection of points, but using a third variable in order to weight that trend line.

For example, picture you had 50 countries and you wanted to plot median age against GDP growth rate. You could do that with a simple scatter chart, then you could plot a trend line against that, either manually or using a program like Excel. Generally, a trend line like that will be based on a "least squares" calculation -- basically, draw the straight line (or some other mathematical kind of line, if that's what you're doing), where the sum of the squared distances of all the scatter points from the line is as small as possible. The problem with that is that it gives all scatter points equal weighting, which doesn't make sense for some kinds of data.... for example, it doesn't make sense to give equal weighting to China, which has well over a billion people, and Monaco, with under 40,000. Each scatter point would have the same "gravitational pull" on the line as each other, where it would make more sense to account for the "mass" of each scatter point by having the pull on the line be proportional to that, so your line is reflective of the impact of those dynamics on people generally, rather than being pulled disproportionately by bunch of small countries.

I can come up with ways to do that manually, but it's really tedious. Basically just have the sum of all squared distances times the third variable be as small as possible. It would be nice if Excel (or a free online chart-maker) had a built-in function for it. Does anyone know of something like that?
 
Back
Top