Hi,
I use the following equation for calculating return for a portfolio of stocks.
gen MOMf3_p1= ( for4r1 [_n-4] + for3r1 [_n-3] + for2r1 [_n-2])/3
for4r1 to for2r1 are returns
_n denotes time
the issue is if one of the returns above go missing the answer I get is a "."
I understand I cannot use egen function to resolve this.
Is there a way?
Thank you.
Sampath
Related Posts with Dealing with missing data
Choice model margins problem: margins after cmclogit producing _outcome#altDear all, I am using data from a choice experiment with an unbalanced panel of 2-3 alternatives per…
Panel data - Following the death of a participant, how to remove all following observations for themHi everyone! I currently am cleaning a very big dataset (52 variables, 82284 observations) for long…
problems creating a graph, diagram, etc.Hello, Creating a graph, a diagram etc. doesn't work in my Stata program. The small box, that usuall…
mycolours package available on SSCThanks as always to Kit Baum who maintains SSC, a new package mycolours is available from SSC. The p…
Deciding on best matching algorithm with kmatchDear statalisters, Based on the paper of King and Nielson (2016) on the comparative analysis of mat…
Subscribe to:
Post Comments (Atom)
0 Response to Dealing with missing data
Post a Comment