I have a dataset with dimension of individuals, observations (e.g income, total broadcast time, followers), and repeated observations for individual (e.g. self_esteem, temperament)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double Income int Broadcast double(Followers CharFC_Rigidity CharFC_AchievementStriving CharC_Conscientiousness PVFC_Hedonism PVFC_UniversalismTolerance Temperament_Choleric Temperament_Sanguine) .0028553554914867 174 4781 .54325507 .427887462999999 .348512656 .430609111 .610872118 0 .5 .00115118237973419 96 3477 .627130717 .698507334 .518466778999999 .409712756 .416587722999999 .25 .75 .000391013993439837 92 3148 .699676972 .623049055 .404087265 .465123295 .697236474 .25 .5 .00231989968001383 144 44641 .652179976 .520213066 .584670489 .591168039 .490490652 .5 .5 .0259434674722192 113 8366 .498777402 .497833064 .38133484 .238997354 .53748539 0 .25 end
Since the dataset in wide format with repeated observations for individuals, I want to reshape it into long format so it can be easier to control and regress later on, but after I wrote this:.
Code:
reshape long CharFC_ CharC_ PVFC_ PVC_ SE_ Role_ Temperament, i(StreamerID) j(Types) string
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float id double Income int Broadcast double(Followers Temperament CharFC_ CharC_) 1 .00411306166423727 104 96751 . . . 1 .00411306166423727 104 96751 . .718679414 . 1 .00411306166423727 104 96751 . . . 1 .00411306166423727 104 96751 . .691145037999999 . 1 .00411306166423727 104 96751 . . . end
Code:
reg Income Broadcast Followers Temperament CharFC_ CharC_ Role_
but, if I try to regress by only put only one of variable from the repeated observations,
Code:
reg Income Broadcast Followers Role_
Nearly the same if I'm using xtreg, fe/re. But this one, variables just went omitted automatically by stata.
Any insight/suggestions/advice for the situation that I have now?
Thank you statalist
0 Response to Transform data from wide to long but then lots of values/observations went missing.
Post a Comment