You are on page 1of 2

How to read and convert most used statistical software package data sets

Download R from (http://cran.r-project.org/)


run: install.packages("Rcmdr") # Installs package
Library('Rcmdr') # Loads the package
Import data (select format and path) // Assign name to file
Use the command: write.dta(Name of file, "File Directory/File Name.dta")
(In R you need to specify directory dividers as either / or \\ not \.)
How to update R in Windows
run: install.packages("installr")
# installing/loading the package:
if(!require(installr)) {
install.packages("installr"); require(installr)} #load / install+load installr
library('installr')
# using the package:
updateR() # this will start the updating process of your R installation. It will check for newer
versions, and if one is available, will guide you through the decisions you'd need to make.
Stata Good Practices
Always use do files
Have your do files organized and annotated
Most times is useful to have do file start with,
set more off
clear
cd "working directory"
Some Stata commands I use quite often,
Makes life easier
cd
clear
set more off
Helps with the data management
collapse
cor
decode
describe
destring
drop
egen
encode
gen
keep
label def
label value
label variable
recode
replace
scatter
string
strrec
sum
tab

Performing analysis
Regression techniques
ivprobit
ivregress
logistic
logit, or / rr
probit
reg, robust
Tests
Chow's test (F-test) long-hand
collin
estat endogenous
estat firststage
estat ic
estat overid
f-test
prais, ssesearch
sktest
vif
whitetst
wntestq
Useful logic statements
==
=!
>
<
|
&

You might also like