407 lines
20 KiB
Plaintext
407 lines
20 KiB
Plaintext
|
|
R Under development (unstable) (2020-03-24 r78051) -- "Unsuffered Consequences"
|
|
Copyright (C) 2020 The R Foundation for Statistical Computing
|
|
Platform: x86_64-apple-darwin19.3.0 (64-bit)
|
|
|
|
R is free software and comes with ABSOLUTELY NO WARRANTY.
|
|
You are welcome to redistribute it under certain conditions.
|
|
Type 'license()' or 'licence()' for distribution details.
|
|
|
|
R is a collaborative project with many contributors.
|
|
Type 'contributors()' for more information and
|
|
'citation()' on how to cite R or R packages in publications.
|
|
|
|
Type 'demo()' for some demos, 'help()' for on-line help, or
|
|
'help.start()' for an HTML browser interface to help.
|
|
Type 'q()' to quit R.
|
|
|
|
> library(foreign)
|
|
> pc5 <- read.dta("pc5.dta")
|
|
Warning message:
|
|
In read.dta("pc5.dta") : cannot read factor labels from Stata 5 files
|
|
> summary(pc5)
|
|
age alb alkphos ascites
|
|
Min. :26.28 Min. :1.960 Min. : -9 Min. :-9.000
|
|
1st Qu.:42.71 1st Qu.:3.330 1st Qu.: 423 1st Qu.: 0.000
|
|
Median :50.47 Median :3.570 Median : 1009 Median : 0.000
|
|
Mean :50.45 Mean :3.543 Mean : 1525 Mean :-2.074
|
|
3rd Qu.:56.99 3rd Qu.:3.820 3rd Qu.: 1677 3rd Qu.: 0.000
|
|
Max. :78.44 Max. :4.640 Max. :13862 Max. : 1.000
|
|
bili chol edema edemarx
|
|
Min. : 0.300 Min. : -9.0 Min. :0.00000 Min. :0.00000
|
|
1st Qu.: 0.700 1st Qu.: -9.0 1st Qu.:0.00000 1st Qu.:0.00000
|
|
Median : 1.200 Median : 256.0 Median :0.00000 Median :0.00000
|
|
Mean : 2.688 Mean : 245.8 Mean :0.09256 Mean :0.07815
|
|
3rd Qu.: 3.000 3rd Qu.: 346.0 3rd Qu.:0.00000 3rd Qu.:0.00000
|
|
Max. :28.000 Max. :1775.0 Max. :1.00000 Max. :1.00000
|
|
hepmeg time plate protime sex
|
|
Min. :-9.00 Min. : 41 Min. : -9 Min. : 9.00 Min. :-9.000
|
|
1st Qu.: 0.00 1st Qu.:1434 1st Qu.:181 1st Qu.:10.00 1st Qu.: 0.000
|
|
Median : 0.00 Median :1487 Median :249 Median :10.60 Median : 1.000
|
|
Mean :-1.75 Mean :1760 Mean :252 Mean :10.67 Mean :-1.434
|
|
3rd Qu.: 1.00 3rd Qu.:2153 3rd Qu.:321 3rd Qu.:11.00 3rd Qu.: 1.000
|
|
Max. : 1.00 Max. :4795 Max. :721 Max. :18.00 Max. : 1.000
|
|
sgot spiders stage cens
|
|
Min. : -9.00 Min. :-9.000 Min. :-9.0000 Min. :0.0000
|
|
1st Qu.: 44.20 1st Qu.: 0.000 1st Qu.: 1.0000 1st Qu.:0.0000
|
|
Median : 88.35 Median : 0.000 Median : 3.0000 Median :0.0000
|
|
Mean : 88.22 Mean :-1.914 Mean : 0.1351 Mean :0.2443
|
|
3rd Qu.:130.20 3rd Qu.: 0.000 3rd Qu.: 3.0000 3rd Qu.:0.0000
|
|
Max. :457.25 Max. : 1.000 Max. : 4.0000 Max. :1.0000
|
|
rx trig copper id
|
|
Min. :-9.0000 Min. : -9.00 Min. : -9.00 Min. : 1.0
|
|
1st Qu.: 1.0000 1st Qu.: -9.00 1st Qu.: 10.00 1st Qu.: 99.5
|
|
Median : 1.0000 Median : 85.00 Median : 48.00 Median :195.0
|
|
Mean :-0.9788 Mean : 81.44 Mean : 65.26 Mean :199.6
|
|
3rd Qu.: 2.0000 3rd Qu.:126.00 3rd Qu.: 88.00 3rd Qu.:302.5
|
|
Max. : 2.0000 Max. :598.00 Max. :588.00 Max. :418.0
|
|
first late t0
|
|
Min. :0.0000 Min. :0.0000 Min. : 0.0
|
|
1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.: 0.0
|
|
Median :0.0000 Median :0.0000 Median : 0.0
|
|
Mean :0.3657 Mean :0.3657 Mean : 543.8
|
|
3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:1487.0
|
|
Max. :1.0000 Max. :1.0000 Max. :1487.0
|
|
> str(pc5)
|
|
'data.frame': 659 obs. of 24 variables:
|
|
$ age : num 58.8 56.4 56.4 70.1 54.7 ...
|
|
$ alb : num 2.6 4.14 4.14 3.48 2.54 ...
|
|
$ alkphos: num 1718 7395 7395 516 6122 ...
|
|
$ ascites: num 1 0 0 0 0 0 0 0 0 0 ...
|
|
$ bili : num 14.5 1.1 1.1 1.4 1.8 ...
|
|
$ chol : num 261 302 302 176 244 244 279 279 248 248 ...
|
|
$ edema : num 1 0 0 1 1 1 0 0 0 0 ...
|
|
$ edemarx: num 1 0 0 0.5 0.5 0.5 0 0 0 0 ...
|
|
$ hepmeg : num 1 1 1 0 1 1 1 1 1 1 ...
|
|
$ time : num 400 1487 4500 1012 1487 ...
|
|
$ plate : num 190 221 221 151 183 183 136 136 -9 -9 ...
|
|
$ protime: num 12.2 10.6 10.6 12 10.3 ...
|
|
$ sex : num 1 1 1 0 1 1 1 1 1 1 ...
|
|
$ sgot : num 137.9 113.5 113.5 96.1 60.6 ...
|
|
$ spiders: num 1 1 1 0 1 1 1 1 0 0 ...
|
|
$ stage : num 4 3 3 4 4 4 3 3 3 3 ...
|
|
$ cens : num 1 0 0 1 0 1 0 0 0 1 ...
|
|
$ rx : num 1 1 1 1 1 1 2 2 2 2 ...
|
|
$ trig : num 172 88 88 55 92 92 72 72 63 63 ...
|
|
$ copper : num 156 54 54 210 64 64 143 143 50 50 ...
|
|
$ id : num 1 2 2 3 4 4 5 5 6 6 ...
|
|
$ first : num 0 1 0 0 1 0 1 0 1 0 ...
|
|
$ late : num 0 0 1 0 0 1 0 1 0 1 ...
|
|
$ t0 : num 0 0 1487 0 0 ...
|
|
- attr(*, "datalabel")= chr ""
|
|
- attr(*, "time.stamp")= chr "14 Feb 1997 14:22"
|
|
- attr(*, "formats")= chr [1:24] "%9.0g" "%9.0g" "%9.0g" "%9.0g" ...
|
|
- attr(*, "types")= int [1:24] 102 102 102 102 102 102 102 102 102 102 ...
|
|
- attr(*, "val.labels")= chr [1:24] "" "" "" "" ...
|
|
- attr(*, "var.labels")= chr [1:24] "" "" "" "" ...
|
|
- attr(*, "version")= int 5
|
|
> compressed <- read.dta("compressed.dta")
|
|
> summary(compressed)
|
|
age alb alkphos ascites
|
|
Min. :26.28 Min. :1.960 Min. : -9 Min. :-9.000
|
|
1st Qu.:42.71 1st Qu.:3.330 1st Qu.: 423 1st Qu.: 0.000
|
|
Median :50.47 Median :3.570 Median : 1009 Median : 0.000
|
|
Mean :50.45 Mean :3.543 Mean : 1525 Mean :-2.074
|
|
3rd Qu.:56.99 3rd Qu.:3.820 3rd Qu.: 1677 3rd Qu.: 0.000
|
|
Max. :78.44 Max. :4.640 Max. :13862 Max. : 1.000
|
|
bili chol edema edemarx
|
|
Min. : 0.300 Min. : -9.0 Min. :0.00000 Min. :0.00000
|
|
1st Qu.: 0.700 1st Qu.: -9.0 1st Qu.:0.00000 1st Qu.:0.00000
|
|
Median : 1.200 Median : 256.0 Median :0.00000 Median :0.00000
|
|
Mean : 2.688 Mean : 245.8 Mean :0.09256 Mean :0.07815
|
|
3rd Qu.: 3.000 3rd Qu.: 346.0 3rd Qu.:0.00000 3rd Qu.:0.00000
|
|
Max. :28.000 Max. :1775.0 Max. :1.00000 Max. :1.00000
|
|
hepmeg time plate protime sex
|
|
Min. :-9.00 Min. : 41 Min. : -9 Min. : 9.00 Min. :-9.000
|
|
1st Qu.: 0.00 1st Qu.:1434 1st Qu.:181 1st Qu.:10.00 1st Qu.: 0.000
|
|
Median : 0.00 Median :1487 Median :249 Median :10.60 Median : 1.000
|
|
Mean :-1.75 Mean :1760 Mean :252 Mean :10.67 Mean :-1.434
|
|
3rd Qu.: 1.00 3rd Qu.:2153 3rd Qu.:321 3rd Qu.:11.00 3rd Qu.: 1.000
|
|
Max. : 1.00 Max. :4795 Max. :721 Max. :18.00 Max. : 1.000
|
|
sgot spiders stage cens
|
|
Min. : -9.00 Min. :-9.000 Min. :-9.0000 Min. :0.0000
|
|
1st Qu.: 44.20 1st Qu.: 0.000 1st Qu.: 1.0000 1st Qu.:0.0000
|
|
Median : 88.35 Median : 0.000 Median : 3.0000 Median :0.0000
|
|
Mean : 88.22 Mean :-1.914 Mean : 0.1351 Mean :0.2443
|
|
3rd Qu.:130.20 3rd Qu.: 0.000 3rd Qu.: 3.0000 3rd Qu.:0.0000
|
|
Max. :457.25 Max. : 1.000 Max. : 4.0000 Max. :1.0000
|
|
rx trig copper id
|
|
Min. :-9.0000 Min. : -9.00 Min. : -9.00 Min. : 1.0
|
|
1st Qu.: 1.0000 1st Qu.: -9.00 1st Qu.: 10.00 1st Qu.: 99.5
|
|
Median : 1.0000 Median : 85.00 Median : 48.00 Median :195.0
|
|
Mean :-0.9788 Mean : 81.44 Mean : 65.26 Mean :199.6
|
|
3rd Qu.: 2.0000 3rd Qu.:126.00 3rd Qu.: 88.00 3rd Qu.:302.5
|
|
Max. : 2.0000 Max. :598.00 Max. :588.00 Max. :418.0
|
|
first late t0
|
|
Min. :0.0000 Min. :0.0000 Min. : 0.0
|
|
1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.: 0.0
|
|
Median :0.0000 Median :0.0000 Median : 0.0
|
|
Mean :0.3657 Mean :0.3657 Mean : 543.8
|
|
3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:1487.0
|
|
Max. :1.0000 Max. :1.0000 Max. :1487.0
|
|
> all.equal(summary(pc5), summary(compressed))
|
|
[1] TRUE
|
|
> sun6 <- read.dta("sun6.dta")
|
|
> summary(sun6)
|
|
age alb alkphos ascites
|
|
Min. :26.28 Min. :1.960 Min. : -9 Min. :-9.000
|
|
1st Qu.:42.71 1st Qu.:3.330 1st Qu.: 423 1st Qu.: 0.000
|
|
Median :50.47 Median :3.570 Median : 1009 Median : 0.000
|
|
Mean :50.45 Mean :3.543 Mean : 1525 Mean :-2.074
|
|
3rd Qu.:56.99 3rd Qu.:3.820 3rd Qu.: 1677 3rd Qu.: 0.000
|
|
Max. :78.44 Max. :4.640 Max. :13862 Max. : 1.000
|
|
bili chol edema edemarx
|
|
Min. : 0.300 Min. : -9.0 Min. :0.00000 Min. :0.00000
|
|
1st Qu.: 0.700 1st Qu.: -9.0 1st Qu.:0.00000 1st Qu.:0.00000
|
|
Median : 1.200 Median : 256.0 Median :0.00000 Median :0.00000
|
|
Mean : 2.688 Mean : 245.8 Mean :0.09256 Mean :0.07815
|
|
3rd Qu.: 3.000 3rd Qu.: 346.0 3rd Qu.:0.00000 3rd Qu.:0.00000
|
|
Max. :28.000 Max. :1775.0 Max. :1.00000 Max. :1.00000
|
|
hepmeg time plate protime sex
|
|
Min. :-9.00 Min. : 41 Min. : -9 Min. : 9.00 Min. :-9.000
|
|
1st Qu.: 0.00 1st Qu.:1434 1st Qu.:181 1st Qu.:10.00 1st Qu.: 0.000
|
|
Median : 0.00 Median :1487 Median :249 Median :10.60 Median : 1.000
|
|
Mean :-1.75 Mean :1760 Mean :252 Mean :10.67 Mean :-1.434
|
|
3rd Qu.: 1.00 3rd Qu.:2153 3rd Qu.:321 3rd Qu.:11.00 3rd Qu.: 1.000
|
|
Max. : 1.00 Max. :4795 Max. :721 Max. :18.00 Max. : 1.000
|
|
sgot spiders stage cens
|
|
Min. : -9.00 Min. :-9.000 Min. :-9.0000 Min. :0.0000
|
|
1st Qu.: 44.20 1st Qu.: 0.000 1st Qu.: 1.0000 1st Qu.:0.0000
|
|
Median : 88.35 Median : 0.000 Median : 3.0000 Median :0.0000
|
|
Mean : 88.22 Mean :-1.914 Mean : 0.1351 Mean :0.2443
|
|
3rd Qu.:130.20 3rd Qu.: 0.000 3rd Qu.: 3.0000 3rd Qu.:0.0000
|
|
Max. :457.25 Max. : 1.000 Max. : 4.0000 Max. :1.0000
|
|
rx trig copper id
|
|
Min. :-9.0000 Min. : -9.00 Min. : -9.00 Min. : 1.0
|
|
1st Qu.: 1.0000 1st Qu.: -9.00 1st Qu.: 10.00 1st Qu.: 99.5
|
|
Median : 1.0000 Median : 85.00 Median : 48.00 Median :195.0
|
|
Mean :-0.9788 Mean : 81.44 Mean : 65.26 Mean :199.6
|
|
3rd Qu.: 2.0000 3rd Qu.:126.00 3rd Qu.: 88.00 3rd Qu.:302.5
|
|
Max. : 2.0000 Max. :598.00 Max. :588.00 Max. :418.0
|
|
first late t0
|
|
Min. :0.0000 Min. :0.0000 Min. : 0.0
|
|
1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.: 0.0
|
|
Median :0.0000 Median :0.0000 Median : 0.0
|
|
Mean :0.3657 Mean :0.3657 Mean : 543.8
|
|
3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:1487.0
|
|
Max. :1.0000 Max. :1.0000 Max. :1487.0
|
|
> str(sun6)
|
|
'data.frame': 659 obs. of 24 variables:
|
|
$ age : num 58.8 56.4 56.4 70.1 54.7 ...
|
|
$ alb : num 2.6 4.14 4.14 3.48 2.54 ...
|
|
$ alkphos: num 1718 7395 7395 516 6122 ...
|
|
$ ascites: int 1 0 0 0 0 0 0 0 0 0 ...
|
|
$ bili : num 14.5 1.1 1.1 1.4 1.8 ...
|
|
$ chol : int 261 302 302 176 244 244 279 279 248 248 ...
|
|
$ edema : int 1 0 0 1 1 1 0 0 0 0 ...
|
|
$ edemarx: num 1 0 0 0.5 0.5 0.5 0 0 0 0 ...
|
|
$ hepmeg : int 1 1 1 0 1 1 1 1 1 1 ...
|
|
$ time : int 400 1487 4500 1012 1487 1925 1487 1504 1487 2503 ...
|
|
$ plate : int 190 221 221 151 183 183 136 136 -9 -9 ...
|
|
$ protime: num 12.2 10.6 10.6 12 10.3 ...
|
|
$ sex : int 1 1 1 0 1 1 1 1 1 1 ...
|
|
$ sgot : num 137.9 113.5 113.5 96.1 60.6 ...
|
|
$ spiders: int 1 1 1 0 1 1 1 1 0 0 ...
|
|
$ stage : int 4 3 3 4 4 4 3 3 3 3 ...
|
|
$ cens : int 1 0 0 1 0 1 0 0 0 1 ...
|
|
$ rx : int 1 1 1 1 1 1 2 2 2 2 ...
|
|
$ trig : int 172 88 88 55 92 92 72 72 63 63 ...
|
|
$ copper : int 156 54 54 210 64 64 143 143 50 50 ...
|
|
$ id : int 1 2 2 3 4 4 5 5 6 6 ...
|
|
$ first : int 0 1 0 0 1 0 1 0 1 0 ...
|
|
$ late : int 0 0 1 0 0 1 0 1 0 1 ...
|
|
$ t0 : int 0 0 1487 0 0 1487 0 1487 0 1487 ...
|
|
- attr(*, "datalabel")= chr ""
|
|
- attr(*, "time.stamp")= chr "14 Sep 2000 10:40"
|
|
- attr(*, "formats")= chr [1:24] "%9.0g" "%9.0g" "%9.0g" "%9.0g" ...
|
|
- attr(*, "types")= int [1:24] 102 102 102 98 102 105 98 102 98 105 ...
|
|
- attr(*, "val.labels")= chr [1:24] "" "" "" "" ...
|
|
- attr(*, "var.labels")= chr [1:24] "" "" "" "" ...
|
|
- attr(*, "version")= int 6
|
|
> all.equal(summary(sun6),summary(pc5))
|
|
[1] TRUE
|
|
> df <- read.dta("datefactor.dta")
|
|
> summary(df)
|
|
hlth159 id adate
|
|
EXCELLENT: 0 Min. : 1.00 Min. :1960-01-02
|
|
VERY GOOD: 6 1st Qu.: 8.25 1st Qu.:1960-01-09
|
|
GOOD : 8 Median :15.50 Median :1960-01-16
|
|
FAIR : 4 Mean :15.50 Mean :1960-01-16
|
|
POOR : 1 3rd Qu.:22.75 3rd Qu.:1960-01-23
|
|
NA's :11 Max. :30.00 Max. :1960-01-31
|
|
> data(esoph)
|
|
> write.dta(esoph,esophile <- tempfile())
|
|
> esoph2 <- read.dta(esophile)
|
|
> all.equal(ordered(esoph2$alcgp),esoph$alcgp)
|
|
[1] TRUE
|
|
> write.dta(esoph,esophile,convert.factors="string")
|
|
> esoph2 <- read.dta(esophile)
|
|
> all.equal(as.character(esoph$alcgp),esoph2$alcgp)
|
|
[1] TRUE
|
|
> write.dta(esoph,esophile,convert.factors="code")
|
|
> esoph2 <- read.dta(esophile)
|
|
> all.equal(as.numeric(esoph$alcgp),as.numeric(esoph2$alcgp))
|
|
[1] TRUE
|
|
>
|
|
> se <- read.dta("stata7se.dta")
|
|
> print(se)
|
|
race number
|
|
1 white 2
|
|
2 asian 5
|
|
3 hispanic 5
|
|
4 white 4
|
|
5 black 5
|
|
6 white 6
|
|
7 black 7
|
|
> v8 <- read.dta("stata8mac.dta")
|
|
> print(v8)
|
|
race number
|
|
1 white 2
|
|
2 asian 5
|
|
3 hispanic 5
|
|
4 white 4
|
|
5 black 5
|
|
6 white 6
|
|
7 black 7
|
|
>
|
|
> stata8 <- read.dta("auto8.dta",missing.type=TRUE,convert.underscore=FALSE)
|
|
> str(stata8)
|
|
'data.frame': 74 obs. of 13 variables:
|
|
$ make : chr "AMC Concord" "AMC Pacer" "AMC Spirit" "Buick Century" ...
|
|
$ price : int 4099 4749 3799 4816 7827 5788 4453 5189 10372 4082 ...
|
|
$ mpg : int 22 17 22 20 15 18 26 20 16 19 ...
|
|
$ rep78 : int 3 3 NA 3 4 3 NA 3 3 3 ...
|
|
$ headroom : num 2.5 3 3 4.5 4 4 3 2 3.5 3.5 ...
|
|
$ trunk : int 11 11 12 16 20 21 10 16 17 13 ...
|
|
$ weight : int 2930 3350 2640 3250 4080 3670 2230 3280 3880 3400 ...
|
|
$ length : int 186 173 168 196 222 218 170 200 207 200 ...
|
|
$ turn : int 40 40 35 40 43 43 34 42 43 42 ...
|
|
$ displacement: int 121 258 121 196 350 231 304 196 231 231 ...
|
|
$ gear_ratio : num 3.58 2.53 3.08 2.93 2.41 ...
|
|
$ foreign : Factor w/ 2 levels "Domestic","Foreign": 1 1 1 1 1 1 1 1 1 1 ...
|
|
$ testmiss : num NA NA NA NA NA NA NA NA NA NA ...
|
|
- attr(*, "datalabel")= chr "1978 Automobile Data"
|
|
- attr(*, "time.stamp")= chr "20 May 2003 14:39"
|
|
- attr(*, "formats")= chr [1:13] "%-18s" "%8.0gc" "%8.0g" "%8.0g" ...
|
|
- attr(*, "types")= int [1:13] 18 252 252 252 254 252 252 252 252 252 ...
|
|
- attr(*, "val.labels")= chr [1:13] "" "" "" "" ...
|
|
- attr(*, "var.labels")= chr [1:13] "Make and Model" "Price" "Mileage (mpg)" "Repair Record 1978" ...
|
|
- attr(*, "version")= int 8
|
|
- attr(*, "label.table")=List of 1
|
|
..$ origin: Named int [1:2] 0 1
|
|
.. ..- attr(*, "names")= chr [1:2] "Domestic" "Foreign"
|
|
- attr(*, "missing")=List of 13
|
|
..$ make : NULL
|
|
..$ price : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ mpg : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ rep78 : num [1:74] NA NA 0 NA NA NA 0 NA NA NA ...
|
|
..$ headroom : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ trunk : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ weight : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ length : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ turn : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ displacement: num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ gear_ratio : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ foreign : num [1:74] NA NA NA NA NA NA NA NA NA NA ...
|
|
..$ testmiss : num [1:74] 18 18 18 18 18 18 18 18 18 18 ...
|
|
>
|
|
> bq <- read.dta("MLLabelsWithNotesChar.dta")
|
|
> str(bq)
|
|
'data.frame': 0 obs. of 1 variable:
|
|
$ female: Factor w/ 2 levels "No","Yes":
|
|
- attr(*, "datalabel")= chr "datalabelBQ"
|
|
- attr(*, "time.stamp")= chr "27 Apr 2013 16:16"
|
|
- attr(*, "formats")= chr "%8.0g"
|
|
- attr(*, "types")= int 251
|
|
- attr(*, "val.labels")= chr "female_lbl_def"
|
|
- attr(*, "var.labels")= chr "Is it female"
|
|
- attr(*, "expansion.fields")=List of 11
|
|
..$ : chr [1:3] "female" "question" "Are you Female?"
|
|
..$ : chr [1:3] "_dta" "_lang_c" "default"
|
|
..$ : chr [1:3] "_dta" "_lang_v_spanish" "etiqdataBQ"
|
|
..$ : chr [1:3] "female" "_lang_l_spanish" "female_lbl_es"
|
|
..$ : chr [1:3] "female" "_lang_v_spanish" "Femenino"
|
|
..$ : chr [1:3] "_dta" "note1" "datasetNoteTxt"
|
|
..$ : chr [1:3] "_dta" "note0" "1"
|
|
..$ : chr [1:3] "female" "note2" "FemaleNote2Txt"
|
|
..$ : chr [1:3] "female" "note0" "2"
|
|
..$ : chr [1:3] "female" "note1" "FemaleNoteTxt"
|
|
..$ : chr [1:3] "_dta" "_lang_list" "default spanish"
|
|
- attr(*, "version")= int 12
|
|
- attr(*, "label.table")=List of 2
|
|
..$ female_lbl_es : Named int [1:2] 0 1
|
|
.. ..- attr(*, "names")= chr [1:2] "No" "Si"
|
|
..$ female_lbl_def: Named int [1:2] 0 1
|
|
.. ..- attr(*, "names")= chr [1:2] "No" "Yes"
|
|
> write.dta(bq, "bq.dta", version = 12)
|
|
> str(read.dta('bq.dta'))
|
|
'data.frame': 0 obs. of 1 variable:
|
|
$ female: Factor w/ 2 levels "No","Yes":
|
|
- attr(*, "datalabel")= chr "datalabelBQ"
|
|
- attr(*, "time.stamp")= chr ""
|
|
- attr(*, "formats")= chr "%9.0g"
|
|
- attr(*, "types")= int 253
|
|
- attr(*, "val.labels")= chr "female_lbl_def"
|
|
- attr(*, "var.labels")= chr "Is it female"
|
|
- attr(*, "expansion.fields")=List of 11
|
|
..$ : chr [1:3] "female" "question" "Are you Female?"
|
|
..$ : chr [1:3] "_dta" "_lang_c" "default"
|
|
..$ : chr [1:3] "_dta" "_lang_v_spanish" "etiqdataBQ"
|
|
..$ : chr [1:3] "female" "_lang_l_spanish" "female_lbl_es"
|
|
..$ : chr [1:3] "female" "_lang_v_spanish" "Femenino"
|
|
..$ : chr [1:3] "_dta" "note1" "datasetNoteTxt"
|
|
..$ : chr [1:3] "_dta" "note0" "1"
|
|
..$ : chr [1:3] "female" "note2" "FemaleNote2Txt"
|
|
..$ : chr [1:3] "female" "note0" "2"
|
|
..$ : chr [1:3] "female" "note1" "FemaleNoteTxt"
|
|
..$ : chr [1:3] "_dta" "_lang_list" "default spanish"
|
|
- attr(*, "version")= int 12
|
|
- attr(*, "label.table")=List of 2
|
|
..$ female_lbl_def: Named int [1:2] 1 2
|
|
.. ..- attr(*, "names")= chr [1:2] "No" "Yes"
|
|
..$ female_lbl_es : Named int [1:2] 0 1
|
|
.. ..- attr(*, "names")= chr [1:2] "No" "Si"
|
|
> unlink("bq.dta")
|
|
>
|
|
> ## PR#15290
|
|
> bq <- read.dta("OneVarTwoValLabels.dta")
|
|
> str(bq)
|
|
'data.frame': 0 obs. of 1 variable:
|
|
$ female: Factor w/ 2 levels "Male","Female":
|
|
- attr(*, "datalabel")= chr ""
|
|
- attr(*, "time.stamp")= chr "25 Apr 2013 21:40"
|
|
- attr(*, "formats")= chr "%9.0g"
|
|
- attr(*, "types")= int 251
|
|
- attr(*, "val.labels")= chr "fem_lbl_val_en"
|
|
- attr(*, "var.labels")= chr ""
|
|
- attr(*, "expansion.fields")=List of 3
|
|
..$ : chr [1:3] "_dta" "_lang_c" "default"
|
|
..$ : chr [1:3] "female" "_lang_l_spanish" "fem_lbl_val_es"
|
|
..$ : chr [1:3] "_dta" "_lang_list" "default spanish"
|
|
- attr(*, "version")= int 12
|
|
- attr(*, "label.table")=List of 2
|
|
..$ fem_lbl_val_es: Named int [1:2] 0 1
|
|
.. ..- attr(*, "names")= chr [1:2] "Masculino" "Femenino"
|
|
..$ fem_lbl_val_en: Named int [1:2] 0 1
|
|
.. ..- attr(*, "names")= chr [1:2] "Male" "Female"
|
|
>
|
|
> ## Dates and date-times in Stata12
|
|
> Sys.setenv(TZ = "UTC") # avoid timezone differences: cannot unset so must be last
|
|
> read.dta("xxx12.dta")
|
|
x xc xbigc xdate
|
|
1 2014-01-23 20:07:16 2014-01-23 20:07:16 2014-01-23 20:07:16 2014-01-23
|
|
2 2014-01-23 20:07:17 2014-01-23 20:07:17 2014-01-23 20:07:17 2014-01-23
|
|
3 2014-01-23 20:07:18 2014-01-23 20:07:18 2014-01-23 20:07:18 2014-01-23
|
|
4 2014-01-23 20:07:19 2014-01-23 20:07:19 2014-01-23 20:07:19 2014-01-23
|
|
5 2014-01-23 20:07:20 2014-01-23 20:07:20 2014-01-23 20:07:20 2014-01-23
|
|
6 2014-01-23 20:07:21 2014-01-23 20:07:21 2014-01-23 20:07:21 2014-01-23
|
|
7 2014-01-23 20:07:22 2014-01-23 20:07:22 2014-01-23 20:07:22 2014-01-23
|
|
8 2014-01-23 20:07:23 2014-01-23 20:07:23 2014-01-23 20:07:23 2014-01-23
|
|
9 2014-01-23 20:07:24 2014-01-23 20:07:24 2014-01-23 20:07:24 2014-01-23
|
|
10 2014-01-23 20:07:25 2014-01-23 20:07:25 2014-01-23 20:07:25 2014-01-23
|
|
>
|
|
> q()
|
|
> proc.time()
|
|
user system elapsed
|
|
0.377 0.063 0.430
|