Hi,
Suppose I have the following observations. I would like to calculate the sales average for each observation based on the weekly average value computed from the other channels. For example, for the first observation, this is channel 1 so I will compute the week sales average based on 10 (channel 2) + 6 (channel 3) from week 1 and divide by two. How can I write a code to do this for a larger dataset. Thanks.
Channel Sales Week Avg
1 3 1
1 9 2
2 10 1
2 2 2
3 6 1
3 15 2
Related Posts with compute mean of other observations
Keep with conditionHey guys, I want to keep only the observations which are untimely by the employee and at the same ti…
Graphing Interaction of Time-Varying Covariate and Dummy Variable in a Growth Curve Model using MIxedGreetings. I have a longitudinal data set (set up in long form), and I am trying to graph a signific…
Creating country specific linear and quadratic time trendsHi everyone, I was trying to include linear and quadratic id specific time trends in my model (sepa…
After estimation, how can I obtain predictions at the mean of some of the covariates?I know that after estimation if I replace some of the covariates with their means and predict, I can…
How to calculate the standard deviation and the average per sector? Hello everyone! I need to calculate the value of the (1) standard deviation and the (2) average (bo…
Subscribe to:
Post Comments (Atom)
0 Response to compute mean of other observations
Post a Comment