stata

Calculating within, between or overall R-square in R

ぐ巨炮叔叔 提交于 2020-12-30 09:42:49
问题 I'm migrating from Stata to R ( plm package ) in order to do panel model econometrics. In Stata, panel models such as random effects usually report the within, between and overall R-squared. I have found that the reported R-squared in the plm Random Effects models corresponds to the within R squared. So, is there any way to get the overall and between R-squared using the plm package in R? See same example with R and Stata: library(plm) library(foreign) # read Stata files download.file('http:/

Calculating within, between or overall R-square in R

跟風遠走 提交于 2020-12-30 09:41:17
问题 I'm migrating from Stata to R ( plm package ) in order to do panel model econometrics. In Stata, panel models such as random effects usually report the within, between and overall R-squared. I have found that the reported R-squared in the plm Random Effects models corresponds to the within R squared. So, is there any way to get the overall and between R-squared using the plm package in R? See same example with R and Stata: library(plm) library(foreign) # read Stata files download.file('http:/

Extract the labels attribute from “labeled” tibble columns from a haven import from Stata

送分小仙女□ 提交于 2020-12-27 17:54:26
问题 Hadley Wickham's haven package, applied to a Stata file, returns a tibble with many columns of type "labeled". You can see these with str(), e.g.: $ MSACMSZ :Class 'labelled' atomic [1:8491861] NA NA NA NA NA NA NA NA NA NA ... .. ..- attr(*, "label")= chr "metropolitan area size (cmsa/msa)" .. ..- attr(*, "labels")= Named int [1:7] 0 1 2 3 4 5 6 .. .. ..- attr(*, "names")= chr [1:7] "not identified or nonmetropolitan" "100,000 - 249,999" "250,000 - 499,999" "500,000 - 999,999" ... It would

Extract the labels attribute from “labeled” tibble columns from a haven import from Stata

戏子无情 提交于 2020-12-27 17:42:36
问题 Hadley Wickham's haven package, applied to a Stata file, returns a tibble with many columns of type "labeled". You can see these with str(), e.g.: $ MSACMSZ :Class 'labelled' atomic [1:8491861] NA NA NA NA NA NA NA NA NA NA ... .. ..- attr(*, "label")= chr "metropolitan area size (cmsa/msa)" .. ..- attr(*, "labels")= Named int [1:7] 0 1 2 3 4 5 6 .. .. ..- attr(*, "names")= chr [1:7] "not identified or nonmetropolitan" "100,000 - 249,999" "250,000 - 499,999" "500,000 - 999,999" ... It would

Extract the labels attribute from “labeled” tibble columns from a haven import from Stata

给你一囗甜甜゛ 提交于 2020-12-27 17:41:53
问题 Hadley Wickham's haven package, applied to a Stata file, returns a tibble with many columns of type "labeled". You can see these with str(), e.g.: $ MSACMSZ :Class 'labelled' atomic [1:8491861] NA NA NA NA NA NA NA NA NA NA ... .. ..- attr(*, "label")= chr "metropolitan area size (cmsa/msa)" .. ..- attr(*, "labels")= Named int [1:7] 0 1 2 3 4 5 6 .. .. ..- attr(*, "names")= chr [1:7] "not identified or nonmetropolitan" "100,000 - 249,999" "250,000 - 499,999" "500,000 - 999,999" ... It would

Convert dates from Stata to R

倖福魔咒の 提交于 2020-12-04 08:36:36
问题 I am having difficulty converting a vector of integers into dates. I've imported a dataset from Stata using: > dataire <- read.dta13("~/lcapm_ireland.dta", convert.factors = TRUE, generate.factors = FALSE, encoding = "UTF-8", fromEncoding = NULL, convert.underscore = FALSE, missing.type = FALSE, convert.dates = TRUE, replace.strl = TRUE, add.rownames = FALSE) My date variable is a monthly time series starting on January 2000 and formatted as "2000-Jan". Similarly to R, Stata handles dates as

Convert dates from Stata to R

佐手、 提交于 2020-12-04 08:34:59
问题 I am having difficulty converting a vector of integers into dates. I've imported a dataset from Stata using: > dataire <- read.dta13("~/lcapm_ireland.dta", convert.factors = TRUE, generate.factors = FALSE, encoding = "UTF-8", fromEncoding = NULL, convert.underscore = FALSE, missing.type = FALSE, convert.dates = TRUE, replace.strl = TRUE, add.rownames = FALSE) My date variable is a monthly time series starting on January 2000 and formatted as "2000-Jan". Similarly to R, Stata handles dates as