I would like to do the correlation matrix between variables P_1, P_5, P_10 P_15, F_1, F_5, F_10 and F_15. This variable change by gid, that is, for each gid there is a level of each variable. To do the correlation matrix, I have seen to do it in this way:
Code:
correlate P_1 P_5 P_10 P_15 F_1 F_5 F_10 F_15
Is it correct or I should take into account that the variables change just by gid in some way?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long gid double P_1 float F_1 double P_5 float F_5 double P_10 float F_10 double P_15 float F_15 134354 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 134351 0 0 0 0 0 0 0 0 135076 0 0 0 0 0 0 0 0 132194 0 0 0 0 .04007463017478585 .08014927 .04007463017478585 .08014927 134359 .01176394278013504 .023751777 .09822201549522855 .20890957 .09817247012371105 .20895955 .09817180978296997 .2089602 134358 0 0 0 0 0 0 0 0 133635 .08393445005640388 .1678689 .18030018685385585 .4346127 .18030018685385585 .4346127 .18030018685385585 .4346127 129322 0 0 0 0 0 0 0 0 132199 0 0 .14702865667641163 .29405725 .14702865667641163 .29405725 .14702865667641163 .29405725 128591 .16112147823704248 .3286662 .1684391041673313 .3679433 .16651572037910245 .3731463 .166511729245172 .3731504 129316 .1417134227231145 .3449112 .13817403067688971 .3488551 .09318399505794517 .8904773 .0928166653157696 .8908536 128590 .21655563104438777 .4335155 .2141394785745051 .4381225 .2141503760482988 .43862665 .21415031955251113 .4386267 132914 .08771977014839649 .1754395 .08771977014839649 .1754395 .2265979517251253 .5674625 .2265979517251253 .5674625 127162 .04218626107579837 .08582425 .06131014307259554 .13004465 .06063969224604719 .13075094 .06063452377607652 .13075624 127154 .1392514005854082 .3042329 .1433500192304491 .3224633 .1386545083880275 .343739 .13876239808705826 .3444274 124999 .15254389122856082 .3769185 .14557006654449367 .3850318 .15941968736732548 .6208977 .1580092585472208 .6319433 127161 .24360373042107852 .4950814 .24261909162194428 .5017406 .23978307680482594 .5094578 .23978195010305206 .50945896 126435 .24488283085236162 .5184296 .2430986802094871 .52442646 .2366716597614108 .5493422 .23659544729109572 .54956865 135070 5.960463766996327e-08 1.1920929e-07 5.960463766996327e-08 1.1920929e-07 5.960463766996327e-08 1.1920929e-07 5.960463766996327e-08 1.1920929e-07 129319 .19557899298524717 .5255644 .18522611692863222 .6748336 .15227016354536715 .7190562 .15164261184371242 .719717 131473 .08935587894029595 .19550623 .19986468445797057 .5276219 .1939725819250664 .5385581 .1939288562208854 .53860223 124998 .09310776667280152 .2074691 .09186692288085396 .20878758 .13673779601415426 .3767616 .13662194028472108 .376879 134362 0 0 .0023586881839037233 .004717422 .0023586881839037233 .004717422 .0023586881839037233 .004717422 135071 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 131472 .18925137980477302 .506433 .18734129977324443 .57813174 .13583165405452746 .8096203 .13540463580034157 .8100586 130039 0 0 0 0 0 0 0 0 129314 .11566560377650603 .2663286 .11300897174106872 .26926267 .14875560245147135 .4467911 .14861365774862456 .4469352 126440 .21231582913605962 .6457127 .17236888036123332 .7241925 .09182162448989573 .8919386 .08740857680432157 .8973336 129315 .10065047481293732 .22693646 .09922894539565164 .2284546 .16371579873190356 .5497969 .1635730921613181 .5499417 131477 0 0 0 0 0 0 0 0 127872 .07898037740642394 .1706579 .08691798879226509 .1929858 .08973510653641936 .21039423 .08997132754426529 .21123737 135792 .05150175001472235 .1030035 .05150175001472235 .1030035 .05150175001472235 .1030035 .05150175001472235 .1030035 126434 .0789805988633816 .17065836 .08691823281859712 .19298637 .08973533115360377 .2103948 .08997155201140439 .2112379 132202 0 0 0 0 0 0 0 0 126441 .19466875837315456 .4976105 .17315353992427873 .52896094 .14882709058671395 .7381306 .14835108290887788 .7386245 132191 .1756727102510922 .4490002 .1788848512375587 .5076004 .1600434598249727 .5615277 .15973737572039326 .5618406 131471 .22288362686413166 .5770314 .21450905467560588 .6150749 .1353279040147406 .8163416 .13471027362647803 .8171507 130760 0 0 0 0 0 0 0 0 135083 0 5.960464e-08 .0023587472946928756 .004717541 .0023587472946928756 .004717541 .0023587472946928756 .004717541 135790 0 0 0 0 0 0 0 0 125001 .15201534362131497 .3739792 .14464654942690203 .3825944 .1595576691834495 .6123372 .15831172042031127 .6231425 127873 .15985716265458905 .3570682 .16341732565094302 .37875965 .15238653434581861 .4102993 .15245226706996418 .4111246 135791 0 0 0 0 0 0 0 0 125717 .0011012771262508929 .0022033358 .0011011985454253497 .0022034144 .0022057127217549747 .0044207573 .0022057096005452755 .0044207606 132918 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 130040 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 130761 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 0 5.960464e-08 128601 0 0 0 0 0 0 0 0 134353 .02868281170958653 .05736559 .02868281170958653 .05736559 .02868281170958653 .05736559 .02868281170958653 .05736559 127883 .003737447233957081 .007497166 .015601962050811727 .03150016 .01559705664497725 .031505078 .015596561979754814 .03150558 132195 .08767405338585377 .17534813 .08767405338585377 .17534813 .08767405338585377 .17534813 .08767405338585377 .17534813 135789 0 0 0 0 0 0 0 0 130037 .031859885435551405 .06371976 .031859885435551405 .06371976 .04890545166563243 .10154987 .04890545166563243 .10154987 124279 .06256633067232542 .13381508 .06209625879545566 .13430275 .14616615780734943 .3924106 .17902943326501397 .6025831 132920 0 0 .0023586881452501984 .004717422 .0023586881452501984 .004717422 .0023586881452501984 .004717422 130762 0 0 0 0 0 0 0 0 130751 .19682145104570736 .4420369 .19774684301752643 .4635974 .18193868317289752 .54973805 .17182677782463696 .6955051 135080 0 0 .0023586881256960623 .004717422 .0023586881256960623 .004717422 .0023586881256960623 .004717422 133632 0 0 0 0 0 0 0 0 127152 .07898055902614942 .17065826 .08691815573408634 .1929862 .08973525508534141 .21039464 .08997147603200961 .2112377 133641 0 5.960464e-08 .0023587472906001494 .004717541 .0023587472906001494 .004717541 .0023587472906001494 .004717541 133633 .0006615905342073347 .0013231424 .0006615905342073347 .0013231424 .0006615905342073347 .0013231424 .0006615905342073347 .0013231424 132912 .003362396235611964 .006743758 .011457929516957264 .023109553 .011466340838257007 .02315067 .011466295900191537 .023150714 133631 0 0 0 0 0 0 0 0 127156 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 133638 0 0 0 0 0 0 0 0 128589 .12592116557061672 .25184235 .12592116557061672 .25184235 .12592116557061672 .25184235 .12592116557061672 .25184235 125719 .21037498882651562 .6002974 .17831006850069286 .6544464 .11218076144663769 .8558511 .10724222271195316 .8639858 131481 0 0 0 0 0 0 0 0 132192 .15353704598419426 .3717862 .1940425425119674 .6411834 .1774955671101015 .674871 .17730616288827328 .6750637 127871 .04862932752280358 .10167368 .2362438243836048 .55214477 .23293290221252672 .5615692 .23284438982216915 .5618167 130755 .06372788353280612 .12780653 .06372788353280612 .12780653 .14152584495411702 .3236759 .14152584495411702 .3236759 128594 .10087026421933842 .2275101 .09944106898907634 .22903673 .14375410016052292 .4121075 .1436106027705666 .4122532 128598 .09719882229728682 .2124547 .09405008862849851 .2159685 .11967288155548417 .30361325 .11961440243449362 .3036726 132193 0 0 0 0 .03020799724617973 .06041605 .03020799724617973 .06041605 130029 .24524873791486468 .4908417 .2365201207758689 .5500377 .17411152446123712 .6867846 .16683807509607013 .6958513 127878 0 0 0 0 0 0 0 0 134356 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 134360 0 5.960464e-08 .009237778715032619 .018475546 .009237778715032619 .018475546 .009237778715032619 .018475546 128597 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 5.9604641222676946e-08 5.960464e-08 132197 0 5.960464e-08 .24923644214868546 .4984729 .24923644214868546 .4984729 .24923644214868546 .4984729 132913 0 0 0 0 0 0 0 0 132200 0 0 .0017490088200702303 .003497988 .0017490088200702303 .003497988 .0017490088200702303 .003497988 126443 .13967427786337794 .3384026 .13628268492930573 .3421722 .16050260499664404 .5917037 .160151321644058 .59206337 130035 .12112932488753358 .26972586 .1186140029006566 .27268785 .19826650704482685 .6726989 .19821927344500434 .6727466 124278 .08598848009569338 .1896967 .08501571752580706 .19072317 .1542211650920331 .4599796 .15412441831845403 .4600775 130036 .00005024419123911272 .0001004909 .00005024419123911272 .0001004909 .002166291682438537 .004333227 .002166291682438537 .004333227 131480 0 0 0 0 0 0 0 0 126438 .13556219555812277 .3114822 .12850280195764618 .3198937 .1505315453826679 .4428734 .15039272749246102 .4430155 130757 .20212268084287643 .4042453 .20212268084287643 .4042453 .20212268084287643 .4042453 .20212268084287643 .4042453 132922 0 0 .0017964043809115537 .0035928285 .0017964043809115537 .0035928285 .0017964043809115537 .0035928285 126436 .0175365426169386 .035145946 .01752877775597855 .035153914 .01823422858374035 .036662754 .018233934951241364 .036663055 130752 .20290403442049865 .5852677 .19183016650127627 .6534629 .10456747712134984 .870454 .08082075959737267 .9073534 125716 .1627672031027032 .3552115 .16547485815282648 .3716862 .15854839600785975 .3943511 .15861038389132598 .3949732 126442 .18807999711862067 .47053415 .16962656854294522 .4966483 .1575203793211628 .6912516 .15702850303967963 .6917824 130038 0 0 .13086765818297863 .26173532 .13086765818297863 .26173532 .13086765818297863 .26173532 129320 .18538690253808454 .4364521 .19071568968141506 .52840024 .16522829427642982 .56318134 .16507356105548254 .56334 131476 .2046387679874897 .4092776 .20685371197760105 .4411597 .20685371197760105 .4411597 .20685371197760105 .4411597 133637 0 0 0 0 0 0 0 0 132915 .249727763235569 .4994556 .249727763235569 .4994556 .23735663783736527 .5543771 .23735663783736527 .5543771 end
0 Response to Correlation matrix
Post a Comment