Announcement

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

  • how to get intraclass correlation coefficient

    Dears,

    I want to get the intraclass correlation coefficient (ICC), I use the following variables. The CompayID is the firm code, my dependent variable is Score and the independent variable is Gender. Other variables are controls. Could you help me and give me the commands for the ICC

    Thanks in advance

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str12 CompayID double Score float Gender double Size float Age double(Lev Curr) float Loss double(ROA SalesGrowth BTM) byte(Big4 Board)
    "000002"   .06255212677231026 1  25.99568574036308 20 .746861 1.585187 0  .050048  .037496  .858083 1 11
    "000002"  .023492560689115115 1  25.99568574036308 21 .770997 1.408135 0  .045325  .415447  .959067 1 11
    "000002"  .051224944320712694 1  25.99568574036308 22 .783163 1.396177 0  .046407  .436505  .928598 1 11
    "000002"   .04344919786096257 1  25.99568574036308 23  .77997 1.343926 0  .042651  .313263 1.032318 1 11
    "000002"  .030564784053156147 1  25.99568574036308 24 .772046 1.344714 0  .039059  .081002  .939043 1 11
    "000002"   .03143313798614811 1  25.99568574036308 25 .777015 1.302247 0  .046351  .335828  .838682 1 11
    "000002"   .05271398747390397 1  25.99568574036308 26 .805367 1.243616 0  .039322  .229754  .935445 1 11
    "000002"   .05558388577256502 0  25.99568574036308 27 .839813 1.200857 0  .037283  .010063  .894484 1 11
    "000002"   .02774049217002237 0  25.99568574036308 28 .845856 1.154342 0   .03658  .225537  .984508 1 11
    "000002"  .020512820512820513 0  25.99568574036308 29  .84359 1.130738 0  .033839  .235873  .955774 1 10
    "000002"   .02368421052631579 0  25.99568574036308 30 .812835 1.174494 0  .032952  .139219   1.0074 1 11
    "000002"   .03558718861209965 0  25.99568574036308 31 .797398 1.220232 0  .019995  .080375 1.075622 1 11
    "000004"  .021479713603818614 0  19.87624566563336 21 .294935 1.921917 0  .048318 -.432705  .266498 0  8
    "000004"  .012690355329949238 0  19.87624566563336 22 .232528 3.020584 0  .040153  .306825  .263854 0  9
    "000004"   .00954653937947494 0  19.87624566563336 23 .403239  2.32833 0  .026648 -.252444  .225264 1  9
    "000004"   .06553398058252427 0  19.87624566563336 24 .534754 1.759327 0  .053838  .107499  .227489 1  9
    "000004"  .015463917525773196 0  19.87624566563336 25 .590402 1.596114 0  .018609  .494308  .116109 0  9
    "000004"   .04555808656036447 0  19.87624566563336 26 .203456 3.657461 0  .127625 1.388206  .116109 0  9
    "000004"   .03333333333333333 0  19.87624566563336 27 .315247 2.068985 0  .023925 -.518178  .138316 1  9
    "000004"  .046052631578947366 0  21.17023294575821 30 .068264 5.195587 0  .040542  1.59159  .610773 1  8
    "000004"   .06838709677419355 0 20.828139196162805 31 .146164 3.934657 1 -.225032   .02999  .417098 0  9
    "000005"  .012195121951219513 0 20.896087368559378 24 .474831  .462402 1 -.033763 -.476352  .417193 0 15
    "000005"   .04455445544554455 0 21.035638430279057 25 .509964  .378206 0  .033784  .013739  .307549 0 15
    "000005"  .030894308943089432 0 21.508996205172462 26  .44704  .832298 1 -.030349  .593989  .212583 0 15
    "000005"  .044657097288676235 0 21.650391804663464 27 .463708  .808671 0  .049547 2.439293  .335435 0 15
    "000005"   .02100840336134454 0 21.792140301856247 28 .517747  .860647 0  .008433  .101811  .521119 0 15
    "000005"  .009140767824497258 0 21.861554945953053 29  .49404 1.144871 0  .051959 -.084271  .734194 0 14
    "000005"  .009191176470588236 0  21.83243585480225 30 .425337  1.24519 0  .058018  .136632  .664938 0 12
    "000005"  .015841584158415842 0  21.62049415153335 31 .459425 1.237466 1 -.140834 -.278113  .644757 0 14
    "000006"  .013807285546415981 0 22.871335447597517 19 .701421 2.034831 0  .062684  .264703  .762243 0  9
    "000006"   .08067226890756303 0 22.842165330823622 20 .652855 1.392666 0  .051404  .107127   .87942 0  9
    "000006"   .09943714821763602 0  22.95793928728631 21 .620165 1.707721 0  .071277  .188072  .771279 1  9
    "000006"   .05714285714285714 0 23.022661852735038 22 .579972 2.501621 0  .072289  .498858  .802897 1  9
    "000006"   .03586206896551724 0  23.18739287145586 23  .64142 1.752962 0  .046967 -.494946  .690853 1  9
    "000006"  .034818941504178275 0 23.328672434536486 27 .528236 1.917972 0  .069209 -.151246  .957162 1  7
    "000006"    .0267515923566879 0  23.47980906925303 28 .544612 2.420668 0  .057582  .485494  .995847 1  7
    "000006"   .05193075898801598 0 23.459887947193014 29 .492185 2.832071 0  .057915 -.213489 1.017437 1  9
    "000006"   .04015544041450777 0 23.884556396872576 30  .65322 2.117493 0  .028358  .052419 1.100916 1  8
    "000007"   .03860294117647059 0  20.48713836630509 21 .624158 1.190722 0  .007696  .891048  .244734 1  9
    "000007"  .009380863039399626 0 20.303973452346135 22 .462754 1.386185 0  .026024 -.314446  .223639 1  8
    "000007"  .005037783375314861 0 19.990055778455957 24 .223847 2.678239 0    .0228 -.500442  .116109 0  8
    "000007"   .03488372093023256 0 20.058448927788085 25 .149962 3.357611 0     .164 -.542216  .116109 0  9
    "000008"  -.04216867469879518 0 20.255860350722134 22 .100605 3.312003 0  .036693 -.081551  .373229 1  7
    "000008"   .05307262569832402 0 22.001238272593127 24 .189809  2.61747 0  .089088 2.439293  .346336 0  7
    "000008"   .05574912891986063 0 22.826504056572375 25 .246583 2.245238 0   .09006  .448569  .434793 0  7
    "000008"   .07224770642201835 0  23.09148090803462 26 .326949 1.890285 0  .094283  .242497  .461561 0  7
    "000008"   .10775047258979206 0   23.0714326028786 27  .29251 2.032443 0  .032338  .100376  .764284 0  9
    "000008"   .07314814814814814 0 23.211877543111683 28 .370962 1.613198 0   .04064  .255465  .835044 0  9
    "000008"   .02977667493796526 0  23.27492033434006 29 .480167 1.347237 1 -.071722 -.404524   .97136 1  9
    "000008"   .09728506787330317 0 23.239305863246106 30 .568954 1.103128 1 -.109394  .155036  .818197 1  9
    "000009"   .08469055374592833 0 23.028312678449613 20  .62953 2.040106 0  .050391 -.016092  .411486 0  9
    "000009"   .07975460122699386 0 23.301308332492873 22 .643669 1.450447 0  .024626 -.010003  .730691 0  8
    "000009"   .07407407407407407 0  23.33420300252946 23 .628798 1.301668 0  .033166  .032409  .669132 0  8
    "000009"  .058465286236297195 0 23.412846220994144 24 .628934 1.649756 0  .033352  .037654  .514714 0  7
    "000009"   .05502846299810247 0 23.619947269468277 25 .638202 1.520796 0  .058826  .135313   .46762 0  7
    "000009"   .05163511187607573 0  23.79701997029718 26 .623791  1.41374 0  .021113  .317541  .608019 0  9
    "000009"  .037996545768566495 0  24.02314876252704 27 .633121  1.64165 0  .013266  .096384  .830901 0  9
    "000009"   .03634085213032581 0 24.119444013647247 28 .649896  1.56606 0  .023352   .66432 1.040815 0  9
    "000009"   .03468208092485549 0 24.131432397236566 29 .645559 1.600159 0  .023705   .02008  .853494 0  8
    "000010"   .02533783783783784 0 20.750676322527728 19 .358152 2.623312 0  .004879  .925853  .366609 0 11
    "000010"  .017892644135188866 0 20.505381472333898 20 .314128 3.522901 1 -.082225 -.364488  .257874 0 10
    "000010"   .05172413793103448 0   22.3646253703931 21 .579577  1.52898 0  .006696 2.439293  .629349 0 10
    "000010"   .04007285974499089 0  22.30292216607111 22 .544721 1.395223 0  .007765  .100431  .704309 0 11
    "000010"  .045774647887323945 0  21.85632884322654 23 .620116 1.542609 1 -.225032 -.280622  .598985 0 11
    "000010"   .03801652892561983 0  21.90905785695954 24 .819505 1.004282 1 -.225032 -.542216  .711696 0 10
    "000010"  .016985138004246284 0  21.98788128532638 26 .769527 1.047169 0  .019495 -.255949  .699459 0 11
    "000010"    .0647985989492119 0 22.246599010651995 27 .812883 1.032569 0  .009656  .247323  .763391 0 11
    "000011"  .050699300699300696 0 21.975916888893643 20 .676791 1.262443 0  .080295  .418244  .836578 0  9
    "000011"   .07441860465116279 0  22.09716011862533 21 .619304 1.399992 0  .099916  .321415  .831157 0  9
    "000011"   .04751131221719457 0 22.077360485543974 22 .534334 1.733302 0  .076902 -.130055  .797321 0  9
    "000011"  .016483516483516484 0  22.07994809174162 23 .465632  2.13654 0  .107651 -.216632  .755345 0  9
    "000011"   .01978021978021978 0  22.20026056124665 24 .520347  1.83314 0  .037957 -.150603  .669504 0  9
    "000011"   .04182509505703422 0 22.618537536404634 25 .637636 1.370795 0   .06432  .911239  .703487 0  9
    "000011"   .03488372093023256 0 22.408429129068047 26 .458117 1.864827 0  .103416  .410589  .704853 0  8
    "000011"  .028933092224231464 0 22.484600829701748 27 .425931 1.943153 0  .105705 -.040435  .915818 1  9
    "000011"  .057746478873239436 0  23.10026166077957 28 .696768 1.818677 0  .083405  .421359  .842691 1  9
    "000011"              .028125 0  23.22530463259445 29 .690259 2.241264 0   .06365  .036021  .805802 1  9
    "000011"   .03959131545338442 0 23.403046675226637 30 .689266 1.978428 0  .073668  .094434  .881525 1  9
    "000012"   .04779411764705882 0  23.45009777218845 23 .442985  .321555 0  .056255 -.089127  .700013 1  9
    "000012"  .054820415879017016 0 23.474195444883925 24 .511696  .447401 0  .035597  .054849  .521317 1  5
    "000012"   .05673758865248227 0 23.695473686671765 26  .55057  .661976 0   .04518  .212313  .713248 0  9
    "000012"  .057803468208092484 0 23.673699139677257 27 .505634  .795466 0  .024436 -.024766  .995812 0  8
    "000012"   .06679764243614932 0 23.624755338558558 28 .457957  .741464 0  .030037 -.013001  .878067 0  8
    "000012"    .0821917808219178 0  23.60711161901976 29 .406367 1.214909 0  .045003  .019025  .729036 0  9
    "000012"   .14655172413793102 0  23.71596173086191 30 .404872 1.663992 0  .082557  .277173  .652884 0  9
    "000014" -.005405405405405406 0  21.18684600235041 19 .647874 1.920765 0  .046593  .059516  .551304 0  9
    "000014"  -.03571428571428571 0 21.309556604663136 20 .663812   2.5092 0  .038165 -.456148  .823913 0  9
    "000014"   .04564315352697095 0 21.426612142160256 21 .686526 1.477084 0  .017379  .053701  .652283 1  9
    "000014"   .07871720116618076 0  21.36127858802748 22 .649425 2.591236 0  .017994  .338565  .573781 1  9
    "000014"  .022988505747126436 0  21.52828274485516 23 .676601 2.638389 0  .030408 -.092446  .520545 1  9
    "000014"  .026694045174537988 0 21.498230300305035 24 .643892 2.741751 0  .024238 -.192651  .361845 1  9
    "000014"  .036334913112164295 0 21.351241972634487 25 .575952 2.264582 0  .014397  .502267  .355382 1  9
    "000014"   .03938730853391685 0  21.14740678285989 26 .476437 2.124267 0   .00646 -.173363  .526536 1  9
    "000014"   .03171953255425709 0 21.374157174161848 27 .504366 1.990499 0  .089694 -.302474  .674889 1  9
    "000014"   .04789272030651341 0 21.402499489732946 28 .515342 1.897148 0  .016522  .224095  .681461 1  9
    "000014"    .0297951582867784 0 21.612673975762544 29 .608096 1.689971 0  .004146 -.208761  .772591 1  9
    "000014"  .024013722126929673 0  21.65498415722297 30 .608645 1.578594 0  .019704  .851127  .807843 1  8
    "000016"   .13561847988077497 0 23.479679719858808 22 .728132 1.107122 0  .003705  .091007 1.024659 1  7
    "000016"    .0913884007029877 0 23.543415353525823 23 .743884 1.137214 0  .003722 -.029153   .94023 1  7
    "000016"  .038910505836575876 0 23.570679036972365 25 .807546   .98231 0  .005854  .103515  .743671 1  7
    end

  • #2
    Originally posted by Em Mohamed View Post
    I want to get the intraclass correlation coefficient (ICC), I use the following variables. . . . Could you help me and give me the commands for the ICC
    Try something like the following on your complete dataset.
    Code:
    assert !missing(real(CompayID))
    destring CompayID, generate(cid)
    mixed Score i.(Gender Loss Big4 Board) c.(Size Age Lev Curr ROA SalesGrowth BTM) || cid:
    estat icc
    I assume that your dataex snippet is unrepresentative inasmuch as the variance component for firm code cannot be estimated from it.

    Comment

    Working...
    X