TransWikia.com

generating a variable

Economics Asked on July 21, 2021

I am trying to generate PMdist`i’ variables, using the following codes

display "************** PM10 distances **************"


forval i=1/12599 {
    display "Attempting to compute distance `i'"

    capture geodist latitude longitude latitude`i' longitude`i' [if] [in], generate(PMdist`i')

    capture replace PMdist`i' = . if (PMdist`i' > 257 & !missing(PMdist`i'))

    capture drop latitude`i' longitude`i'
  }
egen PMmindist = rowmin(PMdist1-PMdist12581)

forval i=1/12599 {

    capture drop PMdist`i'
}

Can anyone tell me why its not working and what is the alternative solution?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP