Share of Foreign Born Workers

The weights will account for the differing sample densities. In R the most common way to include weights in your analysis is using the survey package (and its derivative, srvyr). For example this package includes the svymean() function which calculates weighted means. In your case since you’re calculating statistics for a subpopulation, you should use the subset() or svyby() functions to define the subsample.

The proper method for calculating standard errors and confidence intervals in the ACS and ASEC samples is to use replicate weights. You’ll need to add the variable REPWTP (same for USA and CPS) to your extract, and note that this will greatly increase the size of your extract. Example code for using replicate weights in R can be found on this forum thread.