Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: calculation 'cross differences'

From   Mario Jose <>
Subject   st: calculation 'cross differences'
Date   Thu, 18 Apr 2013 11:59:08 +0100

Dear all,

I have a sample of companies that are subject to different tax rates,
they are owned by different parent companies. I would like to compute
differences of tax rates within each group and in the perspective of
each company. Below is an example of the database and a view of what I
would like to compute:

group company  taxrate
1                 A              15
1                 B              10
1                 C              20
2                 D              20
2                 E              15
2                 F              14
2                 G              30

The task I need to do is calculate the following regarding for
instance companies A, B and C of group 1:

A=> (15-10) + (15-20)
B=> (10-15) + (10-20)
C=> (20-15) + (20-10)

As I have thousands of companies it is a hard to do this manually, is
there any suggestion on how to handle with this calculations?

I would appreciate any help.

Best regards,
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index