similar to: Possible bug in foreign library import of Stata datasets

Displaying 20 results from an estimated 2000 matches similar to: "Possible bug in foreign library import of Stata datasets"

2004 Sep 21
2
Ever see a stata import problem like this?
Greetings Everybody: I generated a 1.2MB dta file based on the general social survey with Stata8 for linux. The file can be re-opened with Stata, but when I bring it into R, it says all the values are missing for most of the variables. This dataset is called "morgen.dta" and I dropped a copy online in case you are interested http://www.ku.edu/~pauljohn/R/morgen.dta looks like this
2008 Jan 26
1
Read stata file from internet?
Dear R-helpers, I would like to have my students read into R an online Stata dataset: 'http://www.stat.ucla.edu/projects/datasets/risk_project.dta' I was able to read it into R after downloading it and converting it with StatTransfer (http://www.stattransfer.com/). Here is what happens when I use read.dta() as I would use read.table(): > require(foreign) > risk2 <-
2018 Mar 22
3
exporting data to stata
Hi, I am new to R and I want to export data into Stata. Could somebody help with that? Thanks a lot. This is the code I am using: > setwd("D:/datasets/Seg-bcn/ESBD") > data1 <- readRDS("r17045_ESDB_Habitatges_BDD_V_1_0.rds") > library(foreign) > write.dta(data="data1", file = "D:/datasets/data1.dta") Error in write.dta(data =
2018 Mar 22
0
exporting data to stata
Hi , library(foreign) write.dta(data1, "data1.dta") should work. The file will be saved in the working directory. Use getwd() to know the working directory. Best wishes Amalraj Raja -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of rosario scandurra Sent: 22 March 2018 07:47 To: r-help at r-project.org Subject: [R] exporting data to stata
2018 Mar 22
1
exporting data to stata
On Thu, Mar 22, 2018 at 4:52 AM, Raja, Dr. Edwin Amalraj <amalraj.raja at abdn.ac.uk> wrote: > Hi , > > library(foreign) > write.dta(data1, "data1.dta") > > should work. I don't think so: > library(foreign) > example(svydesign) > write.dta(dstrat, "~/Downloads/foo.dta") Error in write.dta(dstrat, "~/Downloads/foo.dta") : The
2001 Jul 12
1
Importing STATA files
I'm an R novice who is struggling with the importation STATA files into R. I've loaded "foreign" and tried the example based on the Swiss file, which works fine. I then placed a STATA file, auto6.dta, in my working directory, which is "C:\Program Files\R\rw1030\library\base\data". The following is what happened: > library(foreign) > read.dta(auto6) Error in
2008 Mar 18
2
read.dta for files from stata 9.0
Dear R-helpers, if I want to read a .dta-file generated by stata 9.0 with read.dta (foreign), I get the message "not a stata version 5-8 .dta-file". I'm using R-2.6.2 and the latest version of the foreign package. Has someone any hint? With many thanks, Albrecht
2008 Aug 06
3
Help in running Stata dataset in R
Dear All, I installed R 2.7.0 and tried to call a dataset i had ealier own called on R2.6.2 but i keep on getting an error: use("maltreat.dta") Error in fromchar(x) : character string is not in a standard unambiguous format Tried doing the same with R2.7.1 but i get the same error. However if i call the same on R 2.6.2, there is no error: use("maltreat.dta") > des()
2001 Dec 22
2
No --delete-after?
Is anyone successfully using the Cygwin rsync on Win2k (or NT4) as both daemon and client, with --delete-after working on the client? I can get --delete to work, but I'd prefer to delete files only on a successful transfer, to ensure that the end-user has a working collection of files, no matter what release. For some reason, --delete-after does nothing for me, even as administrator on the
2008 Mar 07
1
read stata data file
Dear R-help list, I'm new to R. I tried to get R to read a Stata data file using the read.dta function in the package "foreign", which I downloaded and extracted to "C:\Program Files\R\R-2.6.2\library" on my pc. I tried > nora <- read.dta("nora.dta") and got Error: could not find function "read.dta" I guess "foreign" needs to
2009 Apr 24
1
stata ==> R - error messages
Dear Sirs, I am just starting with R and I think it is a great system. Now, I want to import Stata datasets (.dta) with read.dta, but receive errormessages like: Error in grep("^(http|ftp|https)://", file) : object "Rklein" not found Error in read.dta("Rklein") : unable to open file: 'No such file or directory' this happens when I use "" What is
2009 Apr 14
1
import from stata
Dear R users, I am trying to import a table from STATA, a dta file. With a table called "table", this is what I do : library("foreign") read.dta(table) It does not work. What am I doing wrong ? Best Regards, Dwayne [[alternative HTML version deleted]]
2009 Dec 16
1
Stata files
I have a client who uses Stata 11. Can anyone advise me on ways of transferring data from this version of Stata to R? Reading the documentation for read.dta in package foreign it seems it only allows for versions up to Stata 10. I don't know Stata at all but a bit of poking around on their website led me to believe Stata 11 couldn't write in Stata 10 format. However Stata 11 can
2014 Jan 23
2
Stata support in package foreign
As you know, Stata support in 'foreign' was frozen a while back at Stata version 12. R-core has received a request from a grad student to 'give top priority' to supporting Stata 13. That is not going to happen, not least because none of us has access to Stata. However, according to Stata's documentation both Stata 12 and 13 use format 115, so foreign::read.dta should be
2009 May 02
1
value labes Stata vs factors
Dear Sir/Madam, I converted my Stata Rgenmetvl.dta file with read.dta succesfully in R's Rgenmetvl.Rdata. However, factors give problem in certain calculations, e.g.: > mean(Rgenmetvl$sex) [1] NA Warning message: In mean.default(Rgenmetvl$sex) : argument is not numeric or logical: returning NA What can I do? In addition to means, summary(Rgenmetvl$sex) works perfectly. Best regards,
2004 May 10
1
Explaining Survival difference between Stata and R
Dear Everybody: I'm doing my usual "how does that work in R" thing with some Stata projects. I find a gross gap between the Stata and R in Cox PH models, and I hope you can give me some pointers about what goes wrong. I'm getting signals from R/Survival that the model just can't be estimated, but Stata spits out numbers just fine. I wonder if I should specify initial
2012 Oct 26
2
Stata Database & R
Dear All, I am given some data to analyze. The data is in the form of a Stata database (.dta file). What is the best way to import it into an R dataframe? Is there any particular caveat I should be aware of? Many thanks Lorenzo
2004 Nov 11
1
polr probit versus stata oprobit
Dear All, I have been struggling to understand why for the housing data in MASS library R and stata give coef. estimates that are really different. I also tried to come up with many many examples myself (see below, of course I did not have the set.seed command included) and all of my `random' examples seem to give verry similar output. For the housing data, I have changed the data into numeric
2000 Apr 04
0
stochastic process transition probabilities estimation
Hi all, I'm new with R (and S), and relatively new to statistics (I'm a computer scientist), so I ask sorry in advance if my question is silly. My problem is this: I have a (sample of a) discrete time stochastic process {X_t} and I want to estimate Pr{ X_t | X_{t-l_1}, X_{t-l_2}, ..., X_{t-l_k} } where l_1, l_2, ..., l_k are some fixed time lags. It will be enough for me to compute
2007 Jul 27
1
reading stata files: preserving values of variables converted to factors
Hi, I am a Stata user new to R. I am using read.dta to read a Stata file that has variables with value labels. read.dta converts them to factors, but seems to recode them with values from 1 to <number of factor levels> (looking at the output of unclass(<varname>)), so the original numerical values are lost. Using convert.factors=FALSE preserves the values, but seems to discard