R

R has a great ability to conduct statistical analysis and has excellent graphic functions for advance users (Lattice package can provide this ability). This program consist of many packages that people can provide. You call those packages and run analyses in a hand way. Learning curve for R is slightly slow at the beginning but once you get more comfortable, you will find R in incomparable to any other statistical software. Also R is a free software!

Part I. Installation of R Program 

Downloadable at http://cran.cnr.berkeley.edu/. Make sure you choose the right version adequate to your OS.  If you never used R before, choose “base” among installation options.  For those who use 64 bit OS for Windows, the installation process will create two R.exe icons on your desk top (one for 32 bit and one for 64 bit). Either one can work well with your computer, but choose one since you need to keep up with maintaining up-to-date package loaded as you advance the program. So I recommend you stick to one type, rather than taking it alternatively. The installation is pretty straight forward. For Window users, make sure you open R with administrator status. So far, assuming that you manage to install R on your computer successfully, you should see the following screen with no problem when you open the R program. R shows two screens – one for output screen and the other for script editor. The latter will help you to organize your commands, so that you can later on using it again with retyping it.

Unlike Stata, R requires a thorough understanding matrix algebra for advance users. Typically, R call on a package in order to execute a run command. This package takes a library function. For example, in order to get the data ready in R, you will need to type  followings in either a script editor (highlight every lines and hit “control + R”  to run the command ) or a command line in output screen (a cursor looking like > in red color).

######Example (begin) #################

install.packages (“foreign”)

#You will be asked to choose a package provided by several constributors (what is called a repository), and simply choose one of them.

library(foreign)

#Unless you indicate a library function, R will not recognize your command. Then, indicate your working directory as followings.

setwd (“TYPE Your target directory”)

# This is a place you tell R where you data directory is located. MAKE SURE C:\\ (or C:/), not C:\

test.data <- read.dta(“filename. dta”)

# This is a stata file for example

#####Example(End) ###################

Part II. Operation and Function with Examples. 

A. Data viewer in R 

1) Install “Rcmdr” package (This will allow you to use R commander window).  Type the following command lines on your R script editor:

install.packages (“Rcmdr”)  # Then choose any target  (I chose USA (1) ) from CRAN mirror.

library(Rcmdr)

2) Now the library function calls Rcmdr package that will be directed to the following R commander window open for you.

** Screen Shot from my own computer  (Click for a larger image)***

Advertisements

Leave a comment for questions / Suggestion. Thanks.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s