- Home
- R-Forge
**survey**: Analysis of Complex Survey Samples**stratsample**: Take a stratified sample

# Take a stratified sample

### Description

This function takes a stratified sample without replacement from a data set.

### Usage

1 | ```
stratsample(strata, counts)
``` |

### Arguments

`strata` |
Vector of stratum identifiers; will be coerced to character |

`counts` |
named vector of stratum sample sizes, with names corresponding to the values of |

### Value

vector of indices into `strata`

giving the sample

### See Also

`sample`

The "sampling" package has many more sampling algorithms.

### Examples

1 2 3 |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.

- anova.svyglm: Model comparison for glms.
- api: Student performance in California schools
- as.fpc: Package sample and population size data
- as.svrepdesign: Convert a survey design to use replicate weights
- as.svydesign2: Update to the new survey design format
- barplot.svystat: Barplots and Dotplots
- bootweights: Compute survey bootstrap weights
- brrweights: Compute replicate weights
- calibrate: Calibration (GREG) estimators
- compressWeights: Compress replicate weight matrix
- confint.svyglm: Confidence intervals for regression parameters
- crowd: Household crowding
- dimnames.DBIsvydesign: Dimensions of survey designs
- election: US 2004 presidential election data at state or county level
- estweights: Estimated weights for missing data
- fpc: Small survey example
- ftable.svystat: Lay out tables of survey statistics
- hadamard: Hadamard matrices
- hospital: Sample of obstetric hospitals
- HR: Wrappers for specifying PPS designs
- make.calfun: Calibration metrics
- marginpred: Standardised predictions (predictive margins) for regression...
- mu284: Two-stage sample from MU284
- nhanes: Cholesterol data from a US survey
- nonresponse: Experimental: Construct non-response weights
- open.DBIsvydesign: Open and close DBI connections
- paley: Paley-type Hadamard matrices
- pchisqsum: Distribution of quadratic forms
- postStratify: Post-stratify a survey
- rake: Raking of replicate weight design
- regTermTest: Wald test for a term in a regression model
- scd: Survival in cardiac arrest
- SE: Extract standard errors
- stratsample: Take a stratified sample
- subset.survey.design: Subset of survey
- surveyoptions: Options for the survey package
- surveysummary: Summary statistics for sample surveys
- svrepdesign: Specify survey design with replicate weights
- svrVar: Compute variance from replicates
- svyby: Survey statistics on subsets
- svycdf: Cumulative Distribution Function
- svychisq: Contingency tables for survey data
- svyciprop: Confidence intervals for proportions
- svycontrast: Linear and nonlinearconstrasts of survey statistics
- svycoplot: Conditioning plots of survey data
- svycoxph: Survey-weighted Cox models.
- svyCprod: Computations for survey variances
- svydesign: Survey sample analysis.
- svyfactanal: Factor analysis in complex surveys (experimental).
- svyglm: Survey-weighted generalised linear models.
- svyhist: Histograms and boxplots
- svykappa: Cohen's kappa for agreement
- svykm: Estimate survival function.
- svyloglin: Loglinear models
- svylogrank: Compare survival distributions
- svymle: Maximum pseudolikelihood estimation in complex surveys
- svyolr: Proportional odds and related models
- svyplot: Plots for survey data
- svyprcomp: Sampling-weighted principal component analysis
- svypredmeans: Predictive marginal means
- svyquantile: Quantiles for sample surveys
- svyranktest: Design-based rank tests
- svyratio: Ratio estimation
- svyrecvar: Variance estimation for multistage surveys
- svysmooth: Scatterplot smoothing and density estimation
- svystandardize: Direct standardization within domains
- svyttest: Design-based t-test
- svy.varcoef: Sandwich variance estimator for glms
- trimWeights: Trim sampling weights
- twophase: Two-phase designs
- update.survey.design: Add variables to a survey design
- weights.survey.design: Survey design weights
- withReplicates: Compute variances by replicate weighting
- with.svyimputationList: Analyse multiple imputations
- yrbs: One variable from the Youth Risk Behaviors Survey, 2015.