Re: [R-sig-Geo] Calculating median age for a group of US census blocks?

2023-08-07 Thread Dexter Locke
Hi Kevin and all, Given the binned data, you could count the number of people per age class for those 10 blocks. You can then express that in a number of different ways, like percent under 25 years old, or by calculating the dependency ratio

Re: [R-sig-Geo] Calculating median age for a group of US census blocks?

2023-08-07 Thread Kevin Zembower via R-sig-Geo
Josiah, thanks for your reply. Regarding my objective, I'm trying to compile census statistics for the blocks that make up the neighborhood where I live. It consists of ten census blocks, of which I selected three for simplicity in my example. The census block-group which contains these ten

Re: [R-sig-Geo] Calculating median age for a group of US census blocks?

2023-08-07 Thread Jeff Boggs
Responses to your questions: Q1: No. It is not mathematically valid, sadly. Q2: I do not know, but your intuition that this is a possible solution is correct. I don't use US Census data anymore, but suspect that the data exists. Whether they are publicly-available is a different question. I

Re: [R-sig-Geo] Calculating median age for a group of US census blocks?

2023-08-07 Thread Kevin Zembower via R-sig-Geo
Yes, I see what you mean: > median(c(60, 50, 40, 20, 20, 20)) [1] 30 > median(c(50, 50, 50, 20, 20, 20)) [1] 35 > Thanks so much for that clear example. -Kevin On 8/7/23 14:45, Sean Trende wrote: > This is correct on the second question, at least for more recent censuses. > On the first

Re: [R-sig-Geo] Calculating median age for a group of US census blocks?

2023-08-07 Thread Sean Trende via R-sig-Geo
This is correct on the second question, at least for more recent censuses. On the first question, imagine a block where the ages of three individuals are 60, 50, and 40, and another one where the ages are 20, 20, and 20. Using your approach you would have 50 * 3 = 150 for the first block, and

Re: [R-sig-Geo] Calculating median age for a group of US census blocks?

2023-08-07 Thread Josiah Parry
Hey Kevin, I don't think you're going to be able to get individual level data from the US Census Bureau. The closest you may be able to get is the current population survey (CPS) which I believe is also available via tidycensus. Regarding your first question, I'm not sure I follow what your

[R-sig-Geo] Calculating median age for a group of US census blocks?

2023-08-07 Thread Kevin Zembower via R-sig-Geo
Hello, all, I'd like to obtain the median age for a population in a specific group of US Decennial census blocks. Here's an example of the problem: ## Example of calculating median age of population in census blocks. library(tidyverse) library(tidycensus) counts <- get_decennial(

Re: [R-sig-Geo] Did I correctly convert my data from UTM zone 12 to 11?

2023-08-07 Thread MAURIZIO MARCHI
 I strongly agree with Michael Sumner. Mathematical adjustments may work but are heavily discouraged. The right way to work is to create two different spatial objects (I recommend to use the vect function of terra package) and then to reproject one of them in the other reference system or both