Download Closest to Storage 0 without type Minimum Maximum being 0 bytes

Document related concepts
no text concepts found
Transcript
Closest to
Storage
0 without
type
Minimum
Maximum being 0 bytes
---------------------------------------------------------------------byte
-127
100 +/-1
1
int
-32,767
32,740 +/-1
2
long
-2,147,483,647
2,147,483,620 +/-1
4
float -1.70141173319*10^38 1.70141173319*10^38 +/-10^-38 4
double -8.9884656743*10^307 8.9884656743*10^307 +/-10^-323 8
---------------------------------------------------------------------Precision for float is 3.795x10^-8.
Precision for double is 1.414x10^-16.
String
storage
Maximum
type
length
Bytes
---------------------------------str1
1
1
str2
2
2
...
.
.
...
.
.
...
.
.
str244
244
244
---------------------------------Strings are stored as str#, for instance, str1, str2, str3, ..., str244. The number after the str indicates the
maximum length of the string. An str5 could hold the word "male", but not the word "female" because
"female" has six characters.
Numbers are stored as byte, int, long, float, or double, with the default being float. byte, int, and long
are said to be of integer type in that they can hold only integers.
recast type varlist [, force]
where type is byte, int, long, float, double, or str1, str2, ..., str244.
destring, replace
tab sexo, m
list if sexo==””
list if sexo!=1 & sexo!=2
st_vartype(var) returns the storage type of the var, such as float, double, or str18.
st_isnumvar(var) returns 1 if var is a numeric variable and 0 otherwise.
st_isstrvar(var) returns 1 if var is a string variable and 0 otherwise.
STATA CLUB 27/04/12
Análisis de sensibilidad:
gen abstemio=(alcoholg==0)
tab abstemio
Opción 1
preserve
drop if abstemio==1
stcox i.oh ...
restore
Opción 2
stcox i.oh... if abstemio==0
Embarazos previos o prevalente en el SUN
gen embarazo=0
replace embarazo==1 if e15==1
replace embarazo==1 if e16==1
replace embarazo==1 if e17==1
...
replace embarazo==1 if e46==1
¿Cómo abreviamos esto?
gen embarazo=0
forvalues x=15/49 {
replace embarazo=1 if e`x'==1
}
gen embarazo=0
foreach var of varlist e15-e49 {
replace embarazo=1 if `var'==1
}
gen embarazo=0
foreach num of numlist 15/49 {
replace embarazo=1 if e`num'==1
}
Related documents