code year var2 top5
1100 201712 5 1
1100 201712 5 2
1100 201712 5 3
1100 201712 4.9 4
1100 201712 4.8 5
1200 201712 6 1
1200 201712 5.9 2
1200 201712 5.4 3
1200 201712 5.4 4
1200 201712 5.4 5
1300 201712 6 1
1300 201712 2 2
1300 201712 1 3
1300 201712 3 4
1300 201712 2 5
1300 201812 6 1
1300 201812 6 2
1300 201812 5 3
1300 201812 4 4
1300 201812 4 5
Dear all ,this is a part of my data.As you can see I sort by code and year.I want to generate a variable.
This variable requires a complicated calculation process. The process is as follows: First, I want to calculate {(1-2)^2+(2-3)^2+(3-4)^2+(4-5)^2}/100 in top5, 1 to 5in the formula must be brought into the value in var2.Thank u so much.
Related Posts with How to create a formla
Help with rounding off in STATAI am new to Stata and I need to create a three-way table. I was trying to export it using "asdoc tab…
robust standard errors using Mata-based d0 ml evaluator using _robust developers' functionDear Statalist, I have a model fitted using ml using a d0 Mata-based evaluator. Now, I am trying to…
Merge while keeping value labels in master and using dataset unchangedHello! I am trying to merge two datasets from a survey which contains household ((HH) level data wi…
Can you make ridgeline plots (aka joyplots) in Stata 16?Hi! I stumbled on this data visualization page https://www.data-to-viz.com/ and realized that ridge…
Need help for "mvreg" command for panel data analysisHi statalist forum. I am very new here. I have been studying stata for a couple months for my master…
Subscribe to:
Post Comments (Atom)
0 Response to How to create a formla
Post a Comment