Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Assistance Needed for Simulating Annual Income Data Across Years

    Dear Statalist members,

    I have to compute the Average Annual Income across districts in Tamil Nadu using data from 2017. I aim to simulate income data for the years 2018 to 2021, based on the distribution of the 2017 data. However, I am encountering challenges with simulating the data for these additional years.

    The dataset for 2017 includes district names, district codes, and income variables, with a unique identifier for each district. Below is a dataex for the 2017 data.

    Could someone kindly assist me with how to proceed with simulating the income data for 2018 to 2021 in Stata? Any suggestions or code examples would be greatly appreciated.

    Thank you in advance for your help!


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str14 districtname_main byte dist_code long(income_agri income_nonagri income_salary income_nonsalary otherincomeactivity) str41 key
    "Vellore"         4      .      .      . 10000      9 "uuid:018bf483-7a8a-4fd1-aec0-eaeffb824adf"
    "Dindugal"       11      .      .      .     .      9 "uuid:01c114c9-6b28-42d3-bb92-d33c6cbb3f6f"
    "Tirunelveli"    27      .      .      .     .      9 "uuid:03ba4e86-5f74-44f8-a647-aa64d3e51dfb"
    "Thanjavur"      19 200000      .      .     .      9 "uuid:0602d011-356e-4816-a22d-80f832de185e"
    "Tirunelveli"    27      9      .      .     .      9 "uuid:07b8c726-99da-438f-a0cc-3cb8a4e615bb"
    "Tiruvannamalai"  5      .      .      .     .      0 "uuid:0876f7e5-35c3-49cc-b7a1-fae26c653e7b"
    "The Nilgiris"   10      .      .      .     .      0 "uuid:0a5c4643-cc59-4b50-aba4-af144210aa87"
    "Thanjavur"      19    300      .      .     .   6000 "uuid:0b16fdda-e1a2-4d5b-8e08-438f620d1ebf"
    "The Nilgiris"   10      .      .      .     .   4000 "uuid:0bdc7771-e322-4976-aa30-ea25480db616"
    "Dindugal"       11      .      .      .     .      9 "uuid:0c3b8e5e-864d-41db-b418-f43836e59758"
    "Theni"          23      .      .      .   650      0 "uuid:0d897e5e-c2f7-43bd-87b7-25b64623dc7d"
    "Perambalur"     14      .      .      .     .      . "uuid:0ec426e4-902b-4f24-b907-aa1a9b8b3522"
    "Thiruvallur"     1      .      . 100000     .      0 "uuid:0f535f75-75dc-4044-965f-7b19db705b3b"
    "Pudukottai"     20      .      .   9000     .      0 "uuid:10d6eabc-d970-450a-94c8-09b8c47c5c3e"
    "Madurai"        22      .      .      .     .      9 "uuid:152f9447-7b27-47c0-a7ea-31209097ab35"
    "The Nilgiris"   10      .      .      .     .      . "uuid:1670398f-508c-4610-aa89-51a19657f3f5"
    "Karur"          12      .      .      .     .      9 "uuid:19ada0c9-ddcf-4ceb-b694-40a2490753bb"
    "Kancheepuram"    3      0 360000      .     .      0 "uuid:19f67482-d288-4a17-888e-c6a9098b8b7d"
    "Ramanathapuram" 25      .      .      .  5000      0 "uuid:1a6b8155-1478-4938-963c-d1bc583638f6"
    "Vellore"         4      .      .      .     .      9 "uuid:1cbaaa01-594a-430a-b1f7-84c7c4ed7060"
    "Thiruvallur"     1      .      .      .     .      9 "uuid:20db1023-d4a0-4f6f-ac1d-405343cf84aa"
    "Thoothukkudi"   26      .      .      9     .  59000 "uuid:21eb8bf5-d881-47e0-9105-1f5c4d16742c"
    "Coimbatore"     31      .      .  10000     .      9 "uuid:22a959fa-6b6d-42b2-82cd-61099e2c5f49"
    "Krishnagiri"    30      .      .      .     .      . "uuid:248d4c7d-25ef-4a92-9c8e-fe33acf680bf"
    "Ramanathapuram" 25  12000      .      .     .   1600 "uuid:25469806-c4c9-4039-88d2-fb7a0368ecf6"
    "Thanjavur"      19   5000      .      .     .      9 "uuid:25d69005-6da6-47ae-b57c-01e603c3f7c2"
    "The Nilgiris"   10      .      .  10000     .      9 "uuid:26bc93bf-9542-42b8-86d6-e463b67f8170"
    "Virudhunagar"   24      .      .      .     .   2000 "uuid:27c80f8a-9640-4999-85fb-59fa2a0f07b7"
    "Thoothukkudi"   26      .      .      .     .      . "uuid:2ac6f725-48bb-4644-9f19-0e203fc3f816"
    "Kancheepuram"    3      .      .      .     .      . "uuid:2b1d056d-b83d-4ff3-b1af-de68e3c30806"
    "Dindugal"       11      .      .      .     .      9 "uuid:2d578cfe-d842-4af8-9b2d-60e64f7eb248"
    "Madurai"        22      0      .  18000     .      0 "uuid:2fb64e0a-4e30-472a-a691-79310147c1b9"
    "Kancheepuram"    3      .      .      .     .      . "uuid:306c8b39-dd88-4480-9ef2-3185d26b4c42"
    "Tiruvannamalai"  5      .      .      .     .      . "uuid:30cfaa37-0e5b-400e-bd60-83d75fe3e099"
    "Tiruvannamalai"  5      .      .      .   200      9 "uuid:3110a7f5-a1f1-496d-838b-8119897d2c23"
    "Thiruvallur"     1      .      .  15000     .      0 "uuid:32327960-bc6f-488a-843e-ce2c4a6dfc6c"
    "Karur"          12      .      .      .     .   7000 "uuid:324accd5-d0f9-4f14-9368-4894f6a75a9c"
    "Coimbatore"     31      .      .      .     .      9 "uuid:3910d1b7-919d-40c9-ab63-e6d43b3deef7"
    "Tiruvannamalai"  5      .      .      . 15000      0 "uuid:398912e6-938a-40ee-afbb-69904dfa9bc5"
    "Virudhunagar"   24      .      .      .  8000      9 "uuid:3adb7f28-795b-48a2-8a9a-67b7d0b349dc"
    "Dindugal"       11      .      .      .     .      . "uuid:3c6178d6-71c1-4137-b13b-3e697cc2a749"
    "Vellore"         4      9      .      9     .      9 "uuid:3d12ba69-6865-423d-a898-96fbce85493c"
    "Karur"          12   8000      .      .     .      9 "uuid:3d74c14a-d70f-4aee-956e-e95dfd0b5d05"
    "Thoothukkudi"   26      .      .      .     .      0 "uuid:3db5bf58-99f3-4ad9-a20d-757258b5db92"
    "Tirunelveli"    27  40000  20000      .     .      0 "uuid:3dea2b0d-f1c2-471e-8b7b-49c67f74a491"
    "Cuddalore"      16      .      .      .     .      9 "uuid:3e105d92-1beb-4692-813a-372722ff8445"
    "Thiruvallur"     1      .      .      .     .  10000 "uuid:3eebb953-36d2-4c16-9a23-79c240eaed37"
    "Thiruvallur"     1      .      .      .     .      . "uuid:3f14ccb7-b391-4efc-a884-5940a46781f3"
    "Coimbatore"     31      .      .      .     .      9 "uuid:40aa1211-52b7-4806-8dc8-ecdc731e134d"
    "Tirunelveli"    27      .      .  20000     9      9 "uuid:40aef207-85cc-4939-b71c-6d3ce7d398b9"
    "Pudukottai"     20      .      .      .     .      0 "uuid:418a0246-53e0-4cd8-915c-1746a3777417"
    "Kancheepuram"    3      .      .  50000     .      9 "uuid:43a06b6d-0e2c-411c-9150-5164e3055d9a"
    "Karur"          12      .      .      .     .      0 "uuid:448a1496-b2d2-4c3e-a26f-b6531696d4a7"
    "Kancheepuram"    3      .      .      .     . 240000 "uuid:44dd366f-c594-4fa0-a98d-bf746ee93625"
    "Tiruvannamalai"  5      .      .      .     .      . "uuid:45be01ae-cfb3-49c9-8ebf-fbda68618914"
    "Ariyalur"       15      0      .      .     .   1000 "uuid:45bfd003-8bcf-4a05-b7eb-08e5ef316620"
    "Tirunelveli"    27      9      .   8000     .  20000 "uuid:46f4161c-22e6-458a-9075-bb5351a7cf77"
    "Tiruvannamalai"  5  25000      .      .     .      0 "uuid:47050e37-b2c8-45e8-aee0-dd5a694ee1f5"
    "Coimbatore"     31      .      .      .     .      0 "uuid:478f62cf-fb44-406a-a135-3a297f55e7bb"
    "Thiruvallur"     1      .      .      .     .      0 "uuid:49ffea64-b2c6-4aef-8619-c2a83e4c0fbc"
    "Kancheepuram"    3      .      . 500000     .      9 "uuid:4ab20ec0-c34a-4b7f-82b8-0cca9a1d0867"
    "Ariyalur"       15      .      .      .     .      0 "uuid:53f2a44c-f101-4272-951a-7c1e9d78bb6f"
    "Coimbatore"     31      .      .  30000   100      9 "uuid:55182760-03a8-4611-a9d1-557281d59229"
    "Pudukottai"     20      .      .      .     .      . "uuid:577f85d5-0726-4a0f-8f00-1c2c5b3e76e5"
    "Nagapattinam"   17      .      .      . 25000      0 "uuid:57ebec77-ea90-4080-996c-7085be285964"
    "Ariyalur"       15      .      .      .     . 180000 "uuid:59de116e-3c72-47e3-926a-056f34664e21"
    "Tiruvannamalai"  5      .      .      .     .   1000 "uuid:5a53aea2-6cec-4922-9173-82b782a5fd43"
    "Vellore"         4      .      .      9     .      9 "uuid:5b7bcdd6-838a-4e2e-a760-dfe8f2104002"
    "Nagapattinam"   17      .      .      .     .      0 "uuid:5e7b443f-8598-4964-9560-f61ea46b1112"
    "Thanjavur"      19      .      .      .     .      9 "uuid:5eb5f7c2-012e-4386-b0c1-9de42aec4c81"
    "Nagapattinam"   17      .      .      .     .      0 "uuid:604e11a4-7d9e-4077-a0e3-1428a5653709"
    "Thoothukkudi"   26      9      .   3000     .      0 "uuid:60ae416b-7d5f-41aa-aad8-32bdbe1f322b"
    "Thiruvarur"     18      .      .    500     .      9 "uuid:616c490a-a1fb-464a-857a-cbdfd5e76a27"
    "Karur"          12      .      .      .     .      . "uuid:6176feac-b2de-451c-a532-d8fdf3bf2131"
    "Krishnagiri"    30  50000      .      .     .      9 "uuid:6274a1ae-1f71-4026-a6b3-178ef77a8e95"
    "Vellore"         4      .      .      .     .      9 "uuid:6321f152-e42c-4792-8117-90b6257e3d87"
    "Ariyalur"       15      .      .      . 12000  15000 "uuid:63cb3e13-c769-4030-aeed-b7d9aacf27bc"
    "Thanjavur"      19  40000      .      .     .      0 "uuid:64d7c06e-bc0a-4282-823d-92ffc7721231"
    "The Nilgiris"   10      .      .      .     .      . "uuid:670da7b0-eaad-431f-9cd0-839d3b596e04"
    "Ramanathapuram" 25      .      .      .     .      0 "uuid:6758757b-a4d9-42e1-b9cc-d839a24a9904"
    "Theni"          23      .      .      .     .      9 "uuid:68683f6e-efd9-4e26-8999-9b1edff7beff"
    "Coimbatore"     31      .      .      .     .      . "uuid:68b01044-fd53-4775-bc01-2018f72fff10"
    "Kancheepuram"    3      .      . 120000     .      0 "uuid:6a1f8a39-18e8-415d-80ba-c340107e93a5"
    "Perambalur"     14 400000      .      .     .  25000 "uuid:6cbd27ad-436b-4880-ae21-a80bf7cdb1b9"
    "Ramanathapuram" 25      .      .    250     .      9 "uuid:6cdd64de-cb86-4ee1-acf5-6af53f02de03"
    "The Nilgiris"   10      .      .      .     .      0 "uuid:6e552105-40c3-489c-b119-3060c2b66609"
    "The Nilgiris"   10   4000      .      .     .      9 "uuid:70c272a6-a652-46ed-881d-4d0d477cddcd"
    "Theni"          23      .      .      .     .   1000 "uuid:721d8078-5491-4000-9ff9-646a6e805d97"
    "Theni"          23      .      .   3000  3000   1000 "uuid:725b175b-6ae9-4539-92c0-ee8cf7fbe784"
    "Tiruvannamalai"  5      .      .      .     .      . "uuid:72a8206a-6896-4787-9758-aff2f8e1004b"
    "Madurai"        22      .      .      .     .      0 "uuid:73427f65-216e-48e9-922e-c97323b6255e"
    "Sivaganga"      21      .      .  10000 10000      0 "uuid:735d5d6f-0809-46a5-b7dd-bcc122a271dd"
    "The Nilgiris"   10      9      .   9000     .      0 "uuid:74f15a80-dec8-4a81-851f-b359fb5aba63"
    "The Nilgiris"   10      .      .      .     .      . "uuid:797ccc03-4459-494c-bc50-bc17d49cb18a"
    "Karur"          12      .      .      .  8000      0 "uuid:7c5b6cdb-8c66-42be-91c4-c9af99c2bec1"
    "Tiruvannamalai"  5   3000      .      .     .      0 "uuid:7e5ab82a-55a6-4359-8a6e-53d7dc979dd8"
    "Madurai"        22      .      .      .  3000      9 "uuid:7edf771d-6431-4d28-8a48-7e51c61885a6"
    "Krishnagiri"    30      .      .      .     .      . "uuid:81752157-ecee-4fc3-9406-5669095608b9"
    "Kancheepuram"    3      .      . 100000     .      9 "uuid:82aaecd1-debf-4c50-9edd-0c0207d2c08f"
    "Coimbatore"     31      .      .      . 50000      0 "uuid:82dfde3f-24c2-492d-b840-5e79d1141d75"
    "Cuddalore"      16      .      .      .  5000      0 "uuid:857ddba6-8e66-498b-8838-57c6125519f6"
    "Madurai"        22      .      .      .     .   3500 "uuid:85a4c247-92e1-4e7c-9078-d2c16260dfc3"
    "Kancheepuram"    3      .      .      .     .      . "uuid:8714dbc1-bfd6-4355-9365-1df5d62987bb"
    "Nagapattinam"   17      .      .      .     .   2000 "uuid:878da32c-d23e-48a2-a3d2-0548eac788a5"
    "Thiruvallur"     1      .      .      .     .      . "uuid:8b439c83-4cdc-40ae-bb17-d09ed1a9ea9f"
    "Karur"          12      9      .  50000 13000      9 "uuid:8ed83634-bd0c-435a-aa20-7b22707db36e"
    "Kancheepuram"    3      .      .  14000     .      0 "uuid:91e7292e-c1c7-4dfd-9e9d-67b8bc4bd8ea"
    "Ariyalur"       15  45000      .      .     .      9 "uuid:91fa5da7-90d2-4f8c-b59c-3022a14d1b10"
    "Thoothukkudi"   26      .      .   4000     .      0 "uuid:9524ff13-3feb-4442-8204-d269bdee49fc"
    "Karur"          12      .      .   7000     .      9 "uuid:96f8616b-e147-4182-bd50-8e6dba9e58a3"
    "Virudhunagar"   24      .      .      .     .      0 "uuid:97dfc3ce-1fb4-47fd-917f-55b94d9ebabf"
    "The Nilgiris"   10      .      .      .     .      . "uuid:99ec71fd-e30f-4f12-90bf-6068c4746819"
    "Krishnagiri"    30      .   5000      .     .    200 "uuid:9c58eb99-4495-4457-bfd4-9abd06b27634"
    "Vellore"         4      .      .      .     .      9 "uuid:9cbb026b-9517-4c65-a464-2b3ac91bc965"
    "Ramanathapuram" 25  18000      . 160000     .      9 "uuid:9ef542fd-aab2-4903-986c-f26f0f785064"
    "Madurai"        22      .      .      .     .      . "uuid:9ef6ce51-497a-4049-972d-a43abf8d1279"
    "Thoothukkudi"   26      .      .      .     .      0 "uuid:a07c1c2a-8009-4fc3-922d-a8caad9a3d48"
    "Theni"          23      .      .      .     .      9 "uuid:a2c303e4-5dfd-49fc-95bf-508bd40be1e6"
    "Thoothukkudi"   26      .      .      .     .   3000 "uuid:a5801fc5-18b1-4660-83ed-551d8de7f152"
    "Vellore"         4      .      .      .     .      9 "uuid:a7b2f383-d25c-48b3-91fc-b8fedb932eba"
    "Dindugal"       11      .      .      .     .      9 "uuid:a8ddadb1-6a27-4401-bb30-c3ef3f5020cd"
    "Vellore"         4      .      .      .     .   5000 "uuid:ad695b91-c30a-4426-b917-b4185e3ba924"
    "Tiruvannamalai"  5      .      .      .     .      . "uuid:b1619642-2706-4728-8541-97bf97259421"
    "The Nilgiris"   10      .      .      9     .   2000 "uuid:b202e2af-596c-428c-9ff5-e5593d3fca38"
    "Krishnagiri"    30      .      .   2400     .      0 "uuid:b2fe7cd5-a427-4c5e-ac24-c0f3e94ae4ed"
    "Vellore"         4      .      .      .     .      0 "uuid:b519d3c5-38bf-42ce-9ab7-da85155dd026"
    "Virudhunagar"   24      .      .   3000     .      0 "uuid:b52a9b07-f21e-4b6e-981d-1dca31e499e9"
    "Thiruvallur"     1      0      .      .     .      0 "uuid:b5bc90a9-65a0-4fec-88f5-50ee659b97f5"
    "Ariyalur"       15      .      .      .     .      9 "uuid:b5cc69fb-dcf4-4c8b-9dc4-b80402b4c5f0"
    "Dindugal"       11      .      .      .     .      9 "uuid:b6183731-7eee-4986-a58f-205bdbe22980"
    "Nagapattinam"   17      .      .  10000     .      0 "uuid:b667c222-e538-4a52-9ab1-b22334bcf796"
    "Vellore"         4      .      .      .     .   2000 "uuid:b71b9992-ba53-4c79-9c21-80d794246096"
    "Kancheepuram"    3      .      .      .     .      9 "uuid:b7d129dc-899c-498d-a007-9df40e4868ec"
    "Virudhunagar"   24      .      .   5000     .      9 "uuid:bb1ef6b3-4547-4292-9b5d-f9cb5c2fceaf"
    "Kancheepuram"    3      .      .  10000     .      0 "uuid:be87e9d4-96db-4be6-b1c9-73f1eeff0626"
    "Karur"          12  10000      .  13000  1000      0 "uuid:bf647d1c-2e6f-4657-9d68-3251f22d08b3"
    "Tiruvannamalai"  5      .      .      .     .      . "uuid:bfbda0dd-aba8-49bd-a45e-7d65847748d5"
    "Kancheepuram"    3      .      . 180000     .      9 "uuid:c0928bdf-c389-48ad-9925-781da6ba37a7"
    "Madurai"        22      .      .      .     .  10000 "uuid:c1cdcf4a-5378-4653-a0d3-05a3fdd7c302"
    "Tiruvannamalai"  5      .      .      .     .      . "uuid:c5637d94-0aa6-4e85-ad68-54075f82b773"
    "Kancheepuram"    3      .      .  10000     .      9 "uuid:c5b496dd-8819-4130-b919-78073503d6ad"
    "Thanjavur"      19      .      .   9600     .      0 "uuid:c7652c84-2921-4f60-b03a-6efe16d57084"
    "Coimbatore"     31      .      .      .     .      9 "uuid:c7654f6d-114f-4a5c-89a4-b80f4807a9de"
    "Thanjavur"      19      .      .      .     .      9 "uuid:c798e38a-7fce-4b4c-be5e-1033f97f5b6b"
    "Ramanathapuram" 25      .      .      .     .  10000 "uuid:ca21305a-6d45-4167-a26a-4bca99e2e52f"
    "The Nilgiris"   10      .      .  22000     .  44000 "uuid:cb1c869a-e4cc-4403-8074-e4ac117e4143"
    "Thoothukkudi"   26  15000      9      9     .      9 "uuid:cb92980d-a77c-466f-9a74-8482f3abc6ea"
    "Kancheepuram"    3      .      .      .     .      . "uuid:cbf440f2-da44-4a75-95fa-fa3119bab841"
    "Ariyalur"       15  40000      .      .     .   5000 "uuid:cc99dfef-30c5-476c-ab5b-15d66221386f"
    "Karur"          12      .      .      .     .      . "uuid:d1f6e6ec-5fae-4800-93aa-1eada4a605b5"
    end

  • #2
    Reddy:
    as far as the year 2017 is concerned, you may want to consider:
    Code:
    . egen income_tot=rowtotal(income_*)
    
    . bysort dist_code: sum income_tot
    Without further assumptions, no reply seems reasonable the year 2018-2021. Is the income expected to increase/decrease?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo,

      I’m also facing the same issues—without making further assumptions on this question, it's difficult to produce the results. I raised this with the team but haven't received a proper response yet. If I do, I’ll let you know.

      That said, the code you shared was really helpful for creating the 2017 income data. Thank you so much for your support!


      Actually this is the question I got from the team "Compute Average Annual Income for different districts in Tamil Nadu using data. By considering the above data of 2017, simulate the data for 2018, 2019, 2020, 2021 using 2017 Distribution. For the Data 2017 -2021, test for significance across years of Annual Average Income (Provide a justification for why you have chosen this test)."
      Last edited by reddy sudhar; 13 Sep 2024, 03:10. Reason: to add the question which i got from the team. i edited the reply

      Comment


      • #4
        Hi Carlo,

        If this is the assumption: 'Is the income expected to increase or decrease?' based on your idea? How should we approach the code to simulate this assumption? If possible, could you share the code? I’m just curious and eager to try it out on my end.

        Comment


        • #5
          Reddy:
          I would take a look at somethimng like the local GDP statistics.
          That said, if the question is not related to a class/homework (if this were the case, please take a look at Help - Statalist #4), it seems ill-posed, without further data/assumptions.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X