mardi 2 novembre 2021

Recently ,I got a task which requires me to use the stratified random sampling method to select 50 sample records covering all cylinders value

Here is the dataset's link http://archive.ics.uci.edu/ml/datasets/Auto+MPG and the file I'm working on is auto-mpg.data Here is my code so far , and I don't know how to calculate the size to find out what i need :

auto <- read.delim("auto_mpg.txt",fill=TRUE,header = FALSE )

colnames(auto) <- c("mpg","cylinders","displacement","horsepower","weight","acceleration","model year","origin","car name") library(sampling)

s=strata(auto,stratanames=c("cylinders","mpg"),size =,method=("srswor"),TRUE)




Aucun commentaire:

Enregistrer un commentaire