- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input long stkcd int year str10(lat1 long1) str11 lat2 str10 long2
- 2 2007 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2008 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2009 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2010 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2011 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2012 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2013 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2014 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2015 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2016 "114.068746" "22.573589" "113.979272" "22.562049"
- 2 2017 "114.068746" "22.573589" "114.070184" "22.552655"
- 2 2018 "114.068746" "22.573589" "114.070184" "22.552655"
- 2 2019 "114.068746" "22.573589" "114.070184" "22.552655"
- 2 2020 "114.068746" "22.573589" "114.070184" "22.552655"
- 4 2007 "114.054117" "22.556835" "114.057334" "22.54277"
- 4 2008 "114.054117" "22.556835" "114.057334" "22.54277"
- 4 2009 "114.054117" "22.556835" "114.057334" "22.54277"
- 4 2010 "114.054117" "22.556835" "114.057334" "22.54277"
- 4 2011 "114.054117" "22.556835" "114.057334" "22.54277"
- 4 2012 "114.054117" "22.556835" "114.057334" "22.54277"
- end
我想生成一个新变量,计算3963*acos[sin(lat1)sin(lat2)+cos(lat1)cos(lat2)cos(long2-long1)]
我用的是gen Distance=3963*acos[sin(lat1)sin(lat2)+cos(lat1)cos(lat2)cos(long2-long1)] 但提示acos not found。如果要安装的话,ssc install acos 好像也不对。不知道该怎么弄?