You are on page 1of 17

. use "C:\Users\Cesar\Desktop\sumaria-2014.

dta", clear

. scalar raiz5 = sqrt(5)

. display raiz5
2.236068

. matrix mat1 = (1,0,1\ 0 , 0 ,1)

. matrix list mat1

mat1[2,3]
c1 c2 c3
r1 1 0 1
r2 0 0 1

. summarize percepho

Variable |

Obs

Mean

Std. Dev.

Min

Max

-------------+--------------------------------------------------------percepho |

30,848

2.162182

. scalar media_percepho = r(mean)

. display media_percepho
2.1621823

. regresse totmieho percepho


command regresse is unrecognized
r(199);

1.10753

10

. regress toomieho percepho


variable toomieho not found
r(111);

. regress totmieho percepho

Source |

SS

df

MS

Number of obs =

-------------+---------------------------------- F(1, 30846)


Model | 47906.4392
Residual | 73187.5738

= 20190.89

1 47906.4392 Prob > F

0.0000

30,846 2.37267632 R-squared

-------------+---------------------------------- Adj R-squared =


Total | 121094.013

30,848

0.3956

0.3956

30,847 3.92563338 Root MSE

1.5403

-----------------------------------------------------------------------------totmieho |

Coef. Std. Err.

P>|t|

[95% Conf. Interval]

-------------+---------------------------------------------------------------percepho | 1.125214 .0079188 142.09 0.000


_cons | 1.356728 .0192372

70.53 0.000

1.109693
1.319022

------------------------------------------------------------------------------

. scalar r2_regi = e(r2)

. display r2_regi
.39561361

. matrix betas = e(b)

. matrix list betas

1.140735
1.394434

betas[1,2]
percepho

_cons

y1 1.125214 1.3567281

. matrix v1 = (1\0)

. matrix result = betas*v1

. matrix list result

symmetric result[1,1]
c1
y1 1.125214

. append using SUMARIA-2013.dta


variable ubigeo is str6 in master but long in using data
You could specify append's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. append using SUMARIA-2013.dta


variable ubigeo is str6 in master but long in using data
You could specify append's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. rename ao ao
variable ao not found
r(111);

. use "C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta", clear

. append using SUMARIA-2013.dta


variable ubigeo is str6 in master but long in using data
You could specify append's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. append using SUMARIA-2013.DTA


variable ubigeo is str6 in master but long in using data
You could specify append's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. rename ao ao

. use "C:\Users\Cesar\Desktop\404-Modulo34\SUMARIA-2013.DTA", clear

. rename ao ao

. save "C:\Users\Cesar\Desktop\404-Modulo34\SUMARIA-2013.DTA", replace


file C:\Users\Cesar\Desktop\404-Modulo34\SUMARIA-2013.DTA saved

. use "C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta", clear

. rename ao ao

. save "C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta", replace

file C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta saved

. append using SUMARIA-2013.DTA


variable ubigeo is str6 in master but long in using data
You could specify append's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. use "C:\Users\Cesar\Desktop\404-Modulo34\SUMARIA-2013.DTA", clear

. destring ubigeo,replace
ubigeo has all characters numeric; replaced as long

. save "C:\Users\Cesar\Desktop\404-Modulo34\SUMARIA-2013.DTA", replace


file C:\Users\Cesar\Desktop\404-Modulo34\SUMARIA-2013.DTA saved

. use "C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta", clear

. append using SUMARIA-2013.DTA


variable ubigeo is str6 in master but long in using data
You could specify append's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. destring ubigeo,replace
ubigeo has all characters numeric; replaced as long

. append using SUMARIA-2013.DTA

(note: variable sg23 was float, now double to accommodate using data's
values)
(note: variable sig24 was float, now double to accommodate using data's
values)
(note: variable ga03hd was long, now double to accommodate using data's
values)
(note: variable sg42 was float, now double to accommodate using data's
values)
(note: variable sg42d was float, now double to accommodate using data's
values)
(note: variable sg421 was float, now double to accommodate using data's
values)
(note: variable sg42d1 was float, now double to accommodate using data's
values)
(note: variable sg422 was float, now double to accommodate using data's
values)
(note: variable sg42d2 was float, now double to accommodate using data's
values)
(note: variable gru33hd2 was int, now long to accommodate using data's
values)
(note: variable gru53hd3 was int, now long to accommodate using data's
values)
(note: variable gru83hd2 was int, now long to accommodate using data's
values)
(note: variable gru86hd2 was byte, now int to accommodate using data's
values)
(note: variable factor07 was float, now double to accommodate using data's
values)

. edit

. use "C:\Users\Cesar\Desktop\404-Modulo34\SUMARIA-2013.DTA", clear

. append using sumaria-2014.dta


file sumaria-2014.dta not found

r(601);

. use "C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta", clear

. append using SUMARIA-2013.DTA


variable ubigeo is str6 in master but long in using data
You could specify append's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. destring ubigeo, replace


ubigeo has all characters numeric; replaced as long

. save "C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta", replace


file C:\Users\Cesar\Desktop\404-Modulo34\sumaria-2014.dta saved

. append using SUMARIA-2013.DTA


(note: variable sg23 was float, now double to accommodate using data's
values)
(note: variable sig24 was float, now double to accommodate using data's
values)
(note: variable ga03hd was long, now double to accommodate using data's
values)
(note: variable sg42 was float, now double to accommodate using data's
values)
(note: variable sg42d was float, now double to accommodate using data's
values)
(note: variable sg421 was float, now double to accommodate using data's
values)
(note: variable sg42d1 was float, now double to accommodate using data's
values)

(note: variable sg422 was float, now double to accommodate using data's
values)
(note: variable sg42d2 was float, now double to accommodate using data's
values)
(note: variable gru33hd2 was int, now long to accommodate using data's
values)
(note: variable gru53hd3 was int, now long to accommodate using data's
values)
(note: variable gru83hd2 was int, now long to accommodate using data's
values)
(note: variable gru86hd2 was byte, now int to accommodate using data's
values)
(note: variable factor07 was float, now double to accommodate using data's
values)

. edit

. edit

. use "C:\Users\Cesar\Desktop\404-Modulo34\404Modulo01\enaho01_2013_100.dta", clear

. gen agua_potable = 1 if p110 < 3


(7,239 missing values generated)

. replace agua_potable = 0 if p 110 >= 3


p ambiguous abbreviation
r(111);

. replace agua_potable = 0 if p110 >= 3


(7,239 real changes made)

. sum agua_potable

Variable |

Obs

Mean

Std. Dev.

Min

Max

-------------+--------------------------------------------------------agua_potable |

30,453

.7622894

.4256879

. sum agua_potable [iw = factor07]

Variable |

Obs

Weight

Mean Std. Dev.

Min

Max

-------------+----------------------------------------------------------------agua_potable | 30,453 8005985.21

.8101306 .3921977

. destring ubigeo, replace


ubigeo has all characters numeric; replaced as long

. gen regin = int(ubigeo/10000)

. label variable regin "Regin"

. label define etiq_regin 1 "Amazonas" 2 "Ancash" 3 "Apurimac" 4 "Arequipa"


5 "Ayacucho" 6 "Cajamarca" 7 "Callao" 8 "Cusc
> o " 9 "Huancavelica" 10 "Huanuco" 11 "Ica" 12 "Junin" 13 "La Libertad" 14
"Lambayeque" 15 "Lima" 16 "Loreto" 17 "Madre d
> e Dios" 18 "Moquegua" 19 "Pasco" 20 "Piura" 21 "Puno" 22 "San Martn" 23
"Tacna" 24 "Tumbes" 25 "Ucayali"

. label value regin etiq_regin

. table regin [iw=factor07], c(mean agua_potable) row

-----------------------------Regin | mean(agua_p~e)

--------------+--------------Amazonas |

.7780771

Ancash |

.9222586

Apurimac |

.8909526

Arequipa |

.8884514

Ayacucho |

.8104231

Cajamarca |

.5757042

Callao |

.8619158

Cusco |

.8453832

Huancavelica |

.7030765

Huanuco |
Ica |

.6286023
.9018438

Junin |

.8473511

La Libertad |

.8265856

Lambayeque |

.8345255

Lima |

.8966205

Loreto |

.489594

Madre de Dios |
Moquegua |
Pasco |

.7941148
.9395779
.5416755

Piura |

.7964748

Puno |

.5826814

San Martn |
Tacna |
Tumbes |
Ucayali |

.7446364
.8794226
.8156635
.5947732

|
Total |

.8101306

------------------------------

. table dominio [iw=factor07] , c(mean agua_potable) row

----------------------------------dominio | mean(agua_p~e)
-------------------+--------------costa norte |

.8390996

costa centro |

.8764842

costa sur |

.8968374

sierra norte |

.6095701

sierra centro |

.7827529

sierra sur |
selva |

.7798194
.6389652

lima metropolitana |

.9066933

|
Total |

.8101306

-----------------------------------

. gen rural = 1 if estrato >=6


(18,742 missing values generated)

. replace rural = 0 if etago <= 5


etago not found
r(111);

. edit

. replace rural = 0 if estrato <= 5


(18,742 real changes made)

. edit

. label variable rural "rural"

. label define etiq_rural 1 " rural" 0 "No rural"

. label value rural etiq_rural

. edit

. table regin rural [iw=factor07] , c(mean agua_potable) row col

-------------------------------------------|

rural

Regin | No rural

rural

Total

--------------+----------------------------Amazonas | .9589028 .6290756 .7780771


Ancash | .964422 .8628069 .9222586
Apurimac | .9644551 .8494254 .8909526
Arequipa | .9271213 .5947058 .8884514
Ayacucho | .9701747 .6502475 .8104231
Cajamarca | .9156907 .3788845 .5757042
Callao | .8619158

.8619158

Cusco | .9644307 .7028097 .8453832


Huancavelica | .9689154 .6232964 .7030765
Huanuco | .9177782 .4452403 .6286023
Ica | .928677 .6467005 .9018438
Junin | .9475623 .6600623 .8473511
La Libertad | .9072422 .5261884 .8265856
Lambayeque | .8974307 .5358748 .8345255
Lima | .9081765 .4301811 .8966205

Loreto | .6982404 .0490684 .489594


Madre de Dios | .942293 .2965695 .7941148
Moquegua | .9873037 .7960945 .9395779
Pasco | .7465044 .2058091 .5416755
Piura | .8545042 .603676 .7964748
Puno | .773772 .4016653 .5826814
San Martn | .8695378 .5119644 .7446364
Tacna | .96071 .4495256 .8794226
Tumbes | .8226604 .7096319 .8156635
Ucayali | .6976995 .2012565 .5947732
|
Total | .897569 .539879 .8101306
--------------------------------------------

.
.
. use "C:\Users\Cesar\Desktop\404-Modulo34\404-Modulo01\SUMARIA2013.DTA", clear

. sort conglome vivienda hogar

. save "C:\Users\Cesar\Desktop\404-Modulo34\404-Modulo01\SUMARIA2013.DTA",replace
file C:\Users\Cesar\Desktop\404-Modulo34\404-Modulo01\SUMARIA-2013.DTA
saved

. nerge m: conglome viviena hogar using enaho01_2013_100.dta


command nerge is unrecognized
r(199);

. nerge m:m conglome vivienda hogar using enaho01_2013_100.dta

command nerge is unrecognized


r(199);

. merge m:m conglome vivienda hogar using enaho01_2013_100.dta


file enaho01_2013_100.dta not found
r(601);

. pwd
C:\Users\Cesar\Desktop\ataSCoSt140_Win\StataCorp Stata MP 14.0
Windows\Stata14\Stata14

. cd "C:\Users\Cesar\Desktop\404-Modulo34"
C:\Users\Cesar\Desktop\404-Modulo34

. merge m:m conglome vivienda hogar using enaho01_2013_100.dta


file enaho01_2013_100.dta not found
r(601);

. merge m:m conglome vivienda hogar using enaho01_2013_100.dta


file enaho01_2013_100.dta not found
r(601);

. pwd
C:\Users\Cesar\Desktop\404-Modulo34

. merge m:m conglome vivienda hogar using enaho01_2013_100.dta


file enaho01_2013_100.dta not found
r(601);

. merge m:m conglome vivienda hogar using enaho01_2013_100x.dta

variable ubigeo is str6 in master but long in using data


You could specify merge's force option to ignore this string/numeric
mismatch. The using variable would then be
treated as if it contained "".
r(106);

. destring ubigeo , replace


ubigeo has all characters numeric; replaced as long

. save "C:\Users\Cesar\Desktop\404-Modulo34\404-Modulo01\SUMARIA2013.DTA", replace


file C:\Users\Cesar\Desktop\404-Modulo34\404-Modulo01\SUMARIA-2013.DTA
saved

. merge m:m conglome vivienda hogar using enaho01_2013_100x.dta

Result

# of obs.

----------------------------------------not matched

9,223

from master
from using

matched

0 (_merge==1)
9,223 (_merge==2)

30,453 (_merge==3)

-----------------------------------------

. gen ipcf = inghog2d/mieperho


(9,223 missing values generated)

. label vari ipcf "Ingreso per capita familiar "

. xtile quintil_ingreso = ipcf [w=factor_personas], nq(5)

factor_personas not found


r(111);

.
. gen factor_personas = factor07*mieperho
(9,223 missing values generated)

. xtile quintil_ingreso = ipcf [w=factor_personas], nq(5)


(analytic weights assumed)

. tab regin quintil_ingreso [iw=factor07], c(mean agua_potable)


option c() not allowed
r(198);

. table regin quintil_ingreso [iw=factor07], c(mean agua_potable)


variable agua_potable not found
r(111);

. gen agua_potable = 1 if p110 < 3


(16,462 missing values generated)

. replace agua_potable = 0 if p110 >= 3


(16,462 real changes made)

. table regin quintil_ingreso [iw=factor07], c(mean agua_potable)

---------------------------------------------------------------|
Regin |

5 quantiles of ipcf
1

--------------+-------------------------------------------------

Amazonas | .6437328 .7677947 .8600227 .914573 .9726634


Ancash | .8558989 .914102 .9357048 .9561639 .9613801
Apurimac | .8826247 .8538252 .9040136 .9417433 .9777834
Arequipa | .6951574 .8282703 .8526567 .9210156 .9488578
Ayacucho | .721078 .8434299 .8757858 .9053798 .974507
Cajamarca | .4112483 .5608993 .7368924 .8727101 .8521723
Callao | .6480528 .6663822 .8167174 .8974044 .9367063
Cusco | .7739888 .7903417 .8643444 .9015909 .9383852
Huancavelica | .6088715 .6981278 .8108025 .9274899 .9487572
Huanuco | .4444147 .6030428 .6874561 .8681795 .9539381
Ica | .6000012 .8601917 .8962408 .9431355 .9080626
Junin | .7010105 .8337193 .8503363 .9124917 .9490794
La Libertad | .6611789 .7999095 .839294 .8908215 .9522583
Lambayeque | .6141219 .8382055 .8578519 .8989703 .9256109
Lima | .7249128 .8148518 .8543013 .9219077 .9359503
Loreto | .1245848 .3983254 .6581813 .7869101 .8358691
Madre de Dios | .5347648 .657594 .7081012 .8032116 .8551218
Moquegua | .8859527 .8753355 .9154946 .9508837 .9840217
Pasco | .3388418 .6090412 .6258578 .6980753 .7858638
Piura | .6529168 .7407186 .8544645 .9065567 .9230466
Puno | .4128609 .6061417 .6887943 .7568814 .731404
--more--

You might also like