# Demographic Estimates Across Geo-Units

**URL:** https://forum.ipums.org/t/demographic-estimates-across-geo-units/4162
**Category:** USA
**Created:** [June 2, 2021, 4:20pm UTC](https://forum.ipums.org/t/demographic-estimates-across-geo-units/4162 "2021-06-02T16:20:46Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Matthew\_Bombyk](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Matthew\_Bombyk](https://forum.ipums.org/u/Matthew_Bombyk)
#### Post date: [June 10, 2021, 6:46pm UTC](https://forum.ipums.org/t/demographic-estimates-across-geo-units/4162/3 "2021-06-10T18:46:09Z")

</div>

I have a couple of suggestions:

First, to get correct standard errors with either the svyttest() or the svyby() followed by the Census tool, you should be using [replicate weights](https://usa.ipums.org/usa/repwt.shtml). The way to incorporate these in R using the survey package is as follows (based on [this thread](https://forum.ipums.org/t/how-can-i-use-replicate-weights-to-create-standard-errors-in-r/2593/10)):

```
svy <- svrepdesign(data = usa_00002, weight = ~PERWT , repweights = “REPWTP[0-9]+”,
    type = “JK1”, scale = 4/ 80 , rscales = rep(1, 80 ), mse = TRUE)

```

I believe the correct syntax for svyttest() would then be:

```
svyttest(percentRACBLK~COUNTYFIP, svy)

```

I’m not sure what this will look like with lots of counties. You might need to make a subset of your data with just the two counties. Also note that not all counties are identified in the ACS microdata.

---

_[View the full topic](https://forum.ipums.org/t/demographic-estimates-across-geo-units/4162)._
