I am thinking is it possible to get mean across various data within each day?
for example, I have the following sample:
I know if I reshape the data to long, I can use -by time, sort:- to calculate mean of variables within each day.
But I want to try -for each- code cause I don't want to reshape to long, then reshape to wide. Could anyone give me some suggestions, please?
I am really grateful!
Best,
Yanyu
for example, I have the following sample:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int Name double(UT1 UT2 UT3) 10959 -.0073132214800006754 0 . 10960 .010169472770298055 .01945556929411236 . 10961 .0072498282100867196 .008194263889847106 . 10962 -.005170111965564398 -.00562484648144707 . 10965 -.002589907056536564 .0010243339747692233 . 10966 -.004948799525782424 -.002049718285617035 . 10967 -.001047186306347277 -.0033377841515116807 . 10968 -.004452292301003223 -.0010298703193938963 . 10969 -.0031516672463765554 -.006724155666651714 . 10972 -.012717640663606661 -.009120310733434348 . 10973 -.0005347650904454377 -.005517277823359298 . 10974 .0013256929755434738 0 . 10975 -.005603395975109575 .0015818014631705153 . 10976 -.0034871366581989095 -.005539094086807045 . 10979 -.0026990278298278008 .0023811580727798793 . 10980 -.010574518872111149 -.007144088554374894 . 10981 -.009032454005356707 -.009877072860297155 . 10982 .009578585767754002 .009877072860297117 . 10983 -.0005461317623971705 .0005266796263820444 . 10986 .006794451225562484 .006086026708618112 . 10987 -.0013573753706163474 -.00028624588717003055 .
But I want to try -for each- code cause I don't want to reshape to long, then reshape to wide. Could anyone give me some suggestions, please?
I am really grateful!
Best,
Yanyu
Comment