Displaying 20 results from an estimated 10000 matches similar to: "Function to modify existing data.frame--Improving R Language"
2005 Jan 18
2
Function to modify existing data.frame
I'm used to statistical languages, such as Stata, in which it's trivial to
pass a list of variables to a function & have that function modify those
variables in the existing dataset rather than create copies of the variables
or having to replace the entire dataset to change a few variables. In R, I
suppose I could paste together the right instructions in a function and then
execute
2003 Jul 13
3
How robust is mle in R?
A newbie question: I'm trying to decide whether to run a maximum likelihood
estimation in R or Stata and am wondering if the R mle routine is reasonably
robust. I'm fairly certain that, with this data, in Stata I would get a lot
of complaints about non-concave functions and unproductive steps attempted,
but would eventually have a successful ML estimate. I believe that, with
the
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,
2009 Jul 11
0
foreign generates bad Stata data files (PR#13820)
Full_Name: peter muhlberger
Version: 2.7.1
OS: Ubuntu x86_64 dual core
Submission from: (NULL) (70.238.206.13)
I've spent half a day generating .dta files using write.dta only to have them
crash my copy of Stata. I eventually discovered that removing a string variable
with a maximum observed length of 280 characters allows Stata to read the file
without problems. A Stata limit is that the
2003 Jul 24
4
Problem w/ source
I'm trying to use the source command to run commands from a file. For
instance: source("do.R"), where do.R is a file in the same directory in
which I am running R.
The contents of do.R are:
ls()
print("hello")
sum(y1)
mean(y1)
After source("do.R"), all I see is:
> source("do.R")
[1] "hello"
I'm using the X11 version of R for
2006 Jan 05
2
Wald tests and Huberized variances (was: A comment about R:)
On Wed, 4 Jan 2006, Peter Muhlberger wrote:
One comment in advance: please use a more meaningful subject. I would have
missed this mail if a colleague hadn't pointed me to it.
> I'm someone who from time to time comes to R to do applied stats for social
> science research.
[snip]
> I would also prefer not to have to work through a
> couple books on R or S+ to learn how to
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
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 Sep 21
1
Exactly Replicating Stata's Survey Data Confidence Intervals in R
Hi everyone, apologies if the answer to this is in an obvious place. I've
been searching for about a day and haven't found anything..
I'm trying to replicate Stata's confidence intervals in R with the survey
package, and the numbers are very very close but not exact. My ultimate
goal is to replicate Berkeley's SDA website with R (http://sda.berkeley.edu/),
which seems to
2009 Jun 30
1
Stata file and R Interaction :File Size Problem in Import
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
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
2003 Feb 19
5
Subpopulations in Complex Surveys
Hi,
is there a way to analyze subpopulations (e.g. women over 50, those who
answered "yes" to a particular question) in a survey using Survey package?
Other packages (e.g. Stata, SUDAAN) do this with a subpopulation option to
identify the subpopulation for which the analysis shoud be done. I did not
see this option in the Survey package. Is there another way to do this?
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 24
4
Can R handle medium and large size data sets?
Dear R experts,
Is it true that R generally cannot handle medium sized data sets(a
couple of hundreds of thousands observations) and threrefore large
date set(couple of millions of observations)?
I googled and I found lots of questions regarding this issue, but
curiously there were no straightforward answers what can be done to
make R capable of handling data.
Is there sth inherent in the
2006 Nov 21
2
Statistical Software Comparison
Hi R users:
I want to know if any of you had used
Stata or Statgraphics.
What are the advantages and disadvantages with
respect to R on the following aspects?
1. Statistical functions or options for advanced
experimental design (fractional, mixed models,
greco-latin squares, split-plot, etc).
2. Bayesian approach to experimental design.
3. Experimental design planing options.
4. Manuals
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
2002 Oct 15
2
glm and Newey-West estimator
Dear R-users,
has anybody combined the glm function with the Newey-West estimator of
variance, similar as in Stata 7.0? I'd like to estimate corrected
standard errors within a logistic regression model, taking into account
the auto-correlated binary observations within individuals.
I use R1.5.1 on Mac OS X (10.2).
Thanks,
Christof
2005 Oct 04
1
"Survey" package and NAMCS data... unsure of specification
Hello, all.
I wanted to use the "survey" package to analyze data from the National
Ambulatory Medical Care Survey, and am having some difficulty translating
the analysis keywords from one package (Stata) to the other (R). The data
were collected using a multistage probability sampling, and there are
variables included to identify the sampling units and weights. Documentation
from the
2013 Feb 13
1
Kernel Density estimation at specific points
Dear All,
I was wondering whether someone has created a kernel density evaluator that
estimates the density at given specified points.
The regular density() function evaluates the kernel at equidistant points,
but I am interested in doing such evaluation along a list of values
existing in a pre-specified vector. (Similar to the option at() in the
kdensity command in Stata).
This question has