Sampling Techniques

A good reading assignment on Sampling Techniques

StatWorkz

There are many different methods through which sampling can be done. Simple Random Sampling is considered to be the ideal sampling method for research, however, paucity of time and money creates the need to opt for other diverse means of sampling.

Probability Methods:

 This is a group of methods to be used for sampling as it further opens the opportunities for the most powerful statistical analysis.

The different probability methods are:

  •  Simple Random Sampling:  It suits and works best when the whole population is available.
  • Stratified Sampling: This kind of sampling works best in a situation when there are specific sub groups to be investigated and the researcher takes up random sampling within the group.
  • Systematic Sampling: This kind of method is workable when a stream of representative people is available.
  • Cluster Sampling: It is largely workable when the population groups are separated and the access…

View original post 133 more words

Advertisements

Assignment 1

ASSIGNMENT 1

Ensure that you have R and RStudio installed in your PC. For installation instructions go to:

Click here to download R

Click here to download RStudio

Once you have successfully installed R and RStudio, create a folder in a place that is easily accessible and call it r_working_directory. Then go to the desktop and right click on the R icon. Select properties. In the “Start In:” text box put the location of your r_working_directory folder

(e.g. C:\Users\Kevin\Documents\r_working_directory)

Be sure to read the R tutorial. Download R manual. Remember that R has an inbuilt help function that is accessible within the console by either typing ? followed by whatever it is you want to know more about or help( ) function. To test this out, type ?help in the R console.

To start us off, we will work with a simple data set. Sign up here to receive the dataset. Put your extracted data into your r_working_directory. Open RStudio and import the first dataset (testdata.txt) and list all the variable names (column names) then import the second dataset and do the same thing. Getting problems? Try the help function and see where you are going wrong. Try opening the dataset in notepad and look at the data. Then try and open each of them in excel (Hint: you have to import the txt file into excel).

Some of the code can be used as below.

The R Code

#First we get our data

mydata <- read.table(“testdata.txt”)

#?read.table

# Help with the function read.table(). Will also list all the arguments associated with the function

#mydata <- read.csv(“testdata.csv”, sep=”,”, header=TRUE)

# sometimes your data is in csv format and you want to tell R as much

names(mydata) #lists all the variable names

 

Submit the following:

  • the output after the names(mydata) function
  • Your excel sheet after importing the data indicating the scale of measurement for each variable