Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Location Data

    Hello,

    I have latitudes and longitude data of school districts from the NCES , and would like to limit my dataset of about 4000 observations to just the latitude and longitude observations to one state and within 50 miles of one of that state's borders.

    The 4000 observations are from 8 states in total. I just want one of those states plus 50 miles to capture border towns near the states.

    Can I use shapefiles of states from census.gov to do so?

    Thank you.

  • #2
    Can someone please assist me if I can use these files: https://www.census.gov/geo/maps-data...cbf_state.html

    perhaps using the shp2data command.

    Comment


    • #3
      Yes, the answer to your question is going to have to involve shapefiles. In Stata 15, by the way, the command is -spshape2dta-. I'm by no means an expert about your problem, but I'm pretty sure that there's no simple way to solve it with existing Stata tools. The user-written program -geoinpoly- (-search geoinpoly-) is the closest thing I can think of, but that only identifies whether a given location is within a region, i.e., whether a point is within a polygon. Given that school districts are substantially sized regions themselves, treating them as single points does not seem like a good idea. (I believe there are school districts in the U. S. Mountain West that are larger than, say, the state of Rhode Island!). So, what you would need would be shapefiles for the districts and the states, and a tool to determine the closest distance between points on each state's polygon and each district's polygon. Having a way to do these distances in Stata would certainly be useful, as would one for the simpler problem of determining how close a point is to a polygon. The best I can say is that I think your question is a good one, so if you don't get an answer, you might try waiting a while and posting again under a subject like "closest distance between two polygons."

      Comment


      • #4
        Thank you Mike for your response.

        I would like to focus on the districts immediately surrounding Kentucky (about 50 miles), so that I do not get massive districts like the Chicago Public School district.

        In what way would I be able to use shpshape2dta (if I download Kentucky districts and districts from 7 bordering states)?
        Or should I download State and School District shapefiles? Once I download them, how can I incorporate them into my dataset?

        Thanks again.

        Comment


        • #5
          As regards how to use -spshape2dta-, I'd suggest going to the PDF documentation of this command (-help spshape2dta-, and in particular to "intro 3" and "intro 4" under the "Also see" tab in the upper right corner of the help. This gives (literally) a step by step approach, and an explanation of shapefiles and how they work.

          There's going to be a fair amount here of playing with FIPS codes and merging to get the data you want. If that kind of thing is unfamiliar to you, I'm afraid your question is much more detailed than can be answered in a forum like this. If you are an experienced Stata user, it might nevertheless be worthwhile trying to solve your current problem in Stata. If not, I'd suggest that what you want would be easy for even a modestly experienced user of standard GIS software to accomplish, and you'd be better off having that person construct a file for you and then export it to Stata.

          I'd also say that, per the FAQ, people generally need to see an excerpt of your data (-dataex- as described in the FAQ) in order to intelligently advise you, as describing a data structure in words is usually difficult. Almost everything you ask here would depend on the structure of your files, coding of states, districts, etc., and we have no way to know what is in your files.

          All this being said: If I had your problem, I'd start by 1) constructing a file of all the school district codes in Kentucky and the surrounding states, which presumably will contain FIPS or other codes to indicate states; and 2) trimming down your shapefile to just the relevant states.

          Comment


          • #6
            Thanks for your response, I will try to implement it.

            Comment

            Working...
            X