I have a cross-sectional dataset with the data example below, where the variable (id) refers to each individual in the df and rows represent the different number of Reddit posts written by each username, which vary across individuals. My goal is to use OLS regression to predict average sentiment, based on individual-level covariates which are all measured at the username-level. For instance, the indicator "collective_action_prop" counts the proportion of collective action mentions across all posts for a given username.
Currently, I ran the OLS model as follows:
regress avg_sentiment avg_response collective_action_prop economic_demand_prop
However, I am not sure if I am correctly running the OLS regression at the username-level with the current data structure where each row represents a Reddit post but the variable id refers to usernames:
* Example generated by -dataex-. For more info, type help dataex
clear
input float id double avg_sentiment float avg_response double(collective_action_prop economic_demand_prop)
1 -1 1 0 1
2 -1 0 0 1
3 0 0 0 0
4 0 . 0 0
4 0 . 0 0
5 1 6 0 0
6 -.2105263157894737 .2105263 0 .2631578947368421
6 -.2105263157894737 .2105263 0 .2631578947368421
6 -.2105263157894737 . 0 .2631578947368421
6 -.2105263157894737 . 0 .2631578947368421
6 -.2105263157894737 . 0 .2631578947368421
6 -.2105263157894737 .2105263 0 .2631578947368421
6 -.2105263157894737 .2105263 0 .2631578947368421
6 -.2105263157894737 .2105263 0 .2631578947368421
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
7 -.2307692307692307 .6923077 .07692307692307693 .3461538461538461
end
----
```
avg_sentiment
for convenience or because you don't know the value ofsentiment
associated with each individual post? $\endgroup$