similar to: R question for Stata users

Displaying 20 results from an estimated 8000 matches similar to: "R question for Stata users"

2010 Jan 21
3
cross validation function translated from stata
Hi, everyone: I ask for help about translating a stata program into R. The program perform cross validation as it stated. #1. Randomly divide the data set into 10 sets of equal size, ensuring equal numbers of events in each set #2. Fit the model leaving out the 1st set #3. Apply the fitted model in (2) to the 1st set to obtain the predicted probability of a prostate cancer diagnosis. #4. Repeat
2008 Sep 04
3
table and colnames
I have a table statement that returns the following: [10.839,10.841] (10.841,10.843] (10.843,10.846] (10.846,10.848] (10.848,10.85] 0 0 0 0 1 (10.85,10.852] (10.852,10.854] (10.854,10.857] (10.857,10.859] (10.859,10.861] 0 0 0 0 0 What I want to do is get the upper bound
2009 Mar 03
4
scatter plot question
Hi R Users, I have a dataframe like this: id x rho A 1 0.1 B 20 0.5 C 2 0.9 ... I want to do a scatter plot of "x" versus "rho" but for each point on the scatter plot I want the corresponding entry for "id" instead of points. In STATA I can do so by twoway (scatter x rho, mlabel(id)) How can I do the same in R? I am sure there is some simple way to do
2012 Apr 30
1
question on jitter in plot.Predict in rms
Dear colleagues, I have a question regarding controlling the jitter when plotting predictions in the rms package. Below I've simulated some data that reflect what I'm working with. The model predicts a continuous variable with an ordinal score, a two-level group, and a continuous covariate. Of primary interest is a plot of the group by score interaction, where the score is the ordinal
2008 Jan 20
2
Newbie question on subsets
Hi... I'm working through the book, A Handbook of Statistical Analyses using R by Everitt, and I'm trying to do the following (p. 19 of his book): boxplot(log(marketvalue)~country, data = subset(Forbes2000, country %in% c("United Kingdom","Germany","India","Turkey")), ylab="log(marketvalue",
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 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
2009 Jun 29
2
Large Stata file Import in R
Hi I am using Stata 10 and I need to import a data set in stata 10 to R, I have saved the dataset in lower versions of Stata as well by using saveold command in Stata. My RAM is 4gb and the stata file is 600MB, I am getting an error message which says : "Error: cannot allocate vector of size 3.4 Mb In addition: There were 50 or more warnings (use warnings() to see the first 50)" Thus
2006 Jan 16
2
importing from Stata
Hi, I have a new job, and everyone here uses Stata. I won't give up on R, but I must learn better how to exchange data between the two softwares. I am now focusing on importing data from Stata to R, and I must confess that I am a bit disappointed with the read.dta function from the foreign package because IT typically happens that (i) I get a big R file (for example, a 15Mb Stata file
2003 Oct 06
1
Re: Use of the Foreign package to import Stata files
Long ago (Sat, 2 Nov 2002), Bill Hart <w.hart at sbcglobal.net> wrote: > An R newbie here. I am using R 1.6 currently and have > (successfully, I think) installed the Foreign package. > Tried to import a data file created with Stata 7.0 > SE. Had minor problems with syntax then R decided > that my file was not really a Stata file. It rejected > the file saying
2013 Oct 15
1
cluster option in stata for random intercept model in the R language?
Dear R-list, I am currently working on a dataset with a colleague who uses stata. We fit a random intercept model to the data (decisions clustered in participants) and get closely the same results in stata (using xtreg re) and R (using the lme4 or multilevel package). Now in stata, there is an additional option for the regression to control for clustering; the vce(cluster clustvar) option,
2008 Feb 13
6
Creating a data.frame
OK...newbie question here. Either I'm reading the docs wrong, or I'm totally confused. Given the following: x<-c("aaa","bbb","ccc") y<-rep(0,3) z<-rep(0,3) is.character(x) [1] TRUE is.numeric(y) [1] TRUE Now...I want to create a data frame, but keep the data types. In reading the docs, I assume you do it this way:
2012 Sep 27
2
equivalent of Stata "by construct"
I am evaluating a switch from Stata to R. I don't need to extensive Statistical methods, but the main reason I am exploring the switch is the coding flexibility in R (e.g. Stata does not support linear/quadratic programming). I have been going over the R syntax and I had a quick question: In Stata, one has a very useful construction called "by", e.g. by month signal: gen xxx =
2006 Jun 23
2
Tetrachoric correlation in R vs. stata
I hope someone here knows the answer to this since it will save me from delving deep into documentation. Based on 22 pairs of vectors, I have noticed that tetrachoric correlation coefficients in stata are almost uniformly higher than those in R, sometimes dramatically so (TCC=.61 in stata, .51 in R; .51 in stata, .39 in R). Stata's estimate is higher than R's in 20 out of 22
2009 May 18
1
discrepancies between stata and r for a cox regression
Hello I would like to develop the use of R. Trying R and more particulary the cox model, I am surprised by discrepancies between results with stata and R for a cox model With the same data base, I get a hazard ratio (4.82) that is not the same obtained with stata (4.52) You will find attached the file leukemia.dta I used (Stata) Here are the codes for R library(foreign)
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
2013 Nov 20
1
Binomial GLM in Stata and R
Hello, I'm not a Stata user so I'm trying to reproduce Stata results that are given to me in R. I would like to use a GLM with a complementary log-log function. The stata code I have is: glm c IndA fia, family(binomial s) link(cloglog) offset(offset) The R code is: glmt <- glm(data=dataset, c ~ IndA + fia, offset = offset, family = binomial(link = cloglog)) Which yields
2008 Jan 13
1
Newbie syntax question
Hi... I'm trying to understand the following syntax: cor.test(~mortality + hardness,data=water,method="pearson") which is the same as: cor.test(water$mortality,water$hardness,data=water,method="pearson") Can anyone point me to the correct doc or explain to me how to interpret "~mortality + hardness"? Thanks, Joe
2009 Sep 01
1
Re gression - cluster option in STATA
Hello In STATA there is command which has regression with clustering option. Can anyone tell me what is the command for the same in R for example in STATA its regress Height Weight, cluster(id) Thanks in Advance Regards Sunita -- View this message in context: http://www.nabble.com/Regression---cluster-option-in-STATA-tp25241948p25241948.html Sent from the R help mailing list archive at
2003 Mar 27
4
Multinomial logistic regression under R and Stata
Dear Colleagues I have been fitting some multinomial logistic regression models using R (version 1.6.1 on a linux box) and Stata 7. Although the vast majority of the parameter estimates and standard errors I get from R are the same as those from Stata (given rounding errors and so on), there are a few estimates for the same model which are quite different. I would be most grateful if