[R] Java vs. C speed

2007-05-11 Thread Peter Muhlberger
I tried writing a textual comparison program in R, but found that it is too slow for my purposes. I need to make about 145 million comparisons of the word patterns in pieces of text. I basically compare vectors that contain count data on a multitude of words and find ones that are similar to

Re: [R] A comment about R:

2006-01-05 Thread Peter Muhlberger
On 1/5/06 11:27 AM, Achim Zeileis [EMAIL PROTECTED] wrote: As John and myself seem to have written our replies in parallel, hence I added some more clarifying remarks in this mail: Note that the Anova() function, also in car, can more conveniently compute Wald tests for certain kinds of

Re: [R] Wald tests and Huberized variances (was: A comment about R:)

2006-01-05 Thread Peter Muhlberger
Thanks Z, it's coming more into focus. I don't know what would work, though maybe it's not impossible to have a richer set of cross-references by interest area--e.g. People interested in econometrics may wish to examine The views help in this regard, tho something in help itself would be

[R] Bug in bootcov; R 2.2

2006-01-04 Thread Peter Muhlberger
There's a bug in my version of bootcov. I'm not sure whether to report it here or in r-bugs, because it is in a contributed package. The bug is straightforward, so perhaps it has been reported, tho I found no reference in a search of the archive. Any attempt to run bootcov with both cluster and

[R] A comment about R:

2006-01-04 Thread Peter Muhlberger
I'm someone who from time to time comes to R to do applied stats for social science research. I think the R language is excellent--much better than Stata for writing complex statistical programs. I am thrilled that I can do complex stats readily in R--sem, maximum likelihood, bootstrapping, some

[R] Bug in bootcov; R 2.2

2006-01-04 Thread Peter Muhlberger
I see that I need to send my bug report to the package maintainer. Apologies for sending it to this list. There's a lot to absorb from various online pages when reporting a bug I missed the part about sending to the maintainer. Peter __

[R] Bootstrap w/ Clustered Data

2006-01-03 Thread Peter Muhlberger
Looks like I may have found a function that addresses my needs. Bootcov in Design handles bootstrapping from clustered data and will save the coefficients. I'm not entirely sure it handles clusters the way I'd like, but I'm going through the code. If it doesn't, it looks easily re-writeable.

[R] Bootstrap w/ Clustered Data

2006-01-02 Thread Peter Muhlberger
Are there any functions in R for running bootstraps with clustered (as opposed to stratified) data? I can't seem to find anything obvious in boot or Bootstrap, though I imagine boot can be manipulated to resample from clusters. Is that what people use? I do see some cluster bootstrap resampling

[R] Testing a linear hypothesis after maximum likelihood

2005-12-22 Thread Peter Muhlberger
I'd like to be able to test linear hypotheses after setting up and running a model using optim or perhaps nlm. One hypothesis I need to test are that the average of several coefficients is less than zero, so I don't believe I can use the likelihood ratio test. I can't seem to find a provision

Re: [R] ML optimization question--unidimensional unfolding scaling

2005-11-03 Thread Peter Muhlberger
Hi Spencer Andy: Thanks for your thoughtful input! I did at one point look at the optim() function run debug on it (wasn't aware of browser--that's helpful!). My impression is that optim() simply calls a C function that handles the maximization. So if I want to break out of my likelihood

Re: [R] ML optimization question--unidimensional unfolding scalin g

2005-11-03 Thread Peter Muhlberger
Hi Spencer: Just realized I may have misunderstood your comments about branching--you may have been thinking about a restart. Sorry if I misrepresented them. See below: On 11/3/05 11:03 AM, Spencer Graves [EMAIL PROTECTED] wrote: Hi, Andy and Peter: That's interesting. I still like the

Re: [R] ML optimization question--unidimensional unfolding scaling

2005-10-13 Thread Peter Muhlberger
Hi Spencer: Thanks for your interest! Also, the posting guide was helpful. I think my problem might be solved if I could find a way to terminate nlm or optim runs from within the user-given minimization function they call. Optimization is unconstrained. I'm essentially using normal like curves

Re: [R] Matrix calculations in R--erroneous?

2005-10-08 Thread Peter Muhlberger
Hi Spencer: Thanks! This gives me a number of other ways of thinking about this problem. My one concern is that these approaches would also run into some difficulties with how long it takes to calculate. I'm interested not in a single value but a matrix of over 300k values that has to be

[R] Matrix calculations in R--erroneous?

2005-10-07 Thread Peter Muhlberger
Does anyone know how -log(x) can equal 743 but -log(x+0)=Inf? That's what the following stream of calculations suggest: Browse[2] -log ( 1e-323+yMat2 - yMat1 * logitShape(matrix(parsList$Xs, nrow = numXs, ncol=numOfCurves), matrix(means, nrow = numXs, ncol=numOfCurves, byrow=TRUE),

Re: [R] Matrix calculations in R--erroneous?

2005-10-07 Thread Peter Muhlberger
estimates. Guess I'll find out. Cheers, Peter On 10/7/05 1:12 PM, Thomas Lumley [EMAIL PROTECTED] wrote: On Fri, 7 Oct 2005, Peter Muhlberger wrote: Does anyone know how -log(x) can equal 743 but -log(x+0)=Inf? That's what the following stream of calculations suggest: Browse[2] -log

[R] ML optimization question--unidimensional unfolding scaling

2005-10-03 Thread Peter Muhlberger
I'm trying to put together an R routine to conduct unidimensional unfolding scaling analysis using maximum likelihood. My problem is that ML optimization will get stuck at latent scale points that are far from optimal. The point optimizes on one of the observed variables but not others and for

Re: [R] a question about linear mixed model in R

2005-01-19 Thread Peter Muhlberger
On 1/19/05 10:31 AM, Chung Chang [EMAIL PROTECTED] wrote: Thanks for your post. Yes, your example is indeed similar to my question. If i means group, j means individual(subject) Isn't 'i' individual j group? h:indicator(0:control;1:experiment) k:repeat(if no repeat then k=1) the the model

Re: [R] Function to modify existing data.frame--Improving R Language

2005-01-19 Thread Peter Muhlberger
Thomas Jeff: Thanks again for your thoughts. The program Thomas suggests below is elegant, but I was avoiding that because I assumed the memory requirements and amount of time required for a large dataset would be substantial. Of course, it depends on what's happening 'under the hood.' Perhaps

[R] Function to modify existing data.frame

2005-01-18 Thread Peter Muhlberger
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,

[R] a question about linear mixed model in R

2005-01-18 Thread Peter Muhlberger
Hi Chung Cheng: This seems related to a problem I'm having in some data of mine as well. I'm new to R (played w/ it some a year ago) to lme modeling, so take this w/ a grain of salt, but here are some thoughts: In my problem, D would be an indicator of whether a subject was in the control

[R] Book recommendations: Multilevel longitudinal analysis

2003-08-25 Thread Peter Muhlberger
Hi, does anyone out there have a recommendation for multilevel / random effects and longitudinal analysis? My dream book would be something that's both accessible to a non-statistician but rigorous (because I seem to be slowly turning into a statistician) and ideally would use R. Peter

[R] Re: Programs stopped working--.print

2003-07-26 Thread Peter Muhlberger
Thank you to everyone who replied to my curious problem, which just got more curious. Today I closed my copy of R, opened up a different copy of .RData (in another directory), one that didn't have the .print problem. Worked w/ that for a few minutes. Then closed R again restarted from the copy

[R] Programs stopped working--.print (newbie question)

2003-07-25 Thread Peter Muhlberger
I must have messed up my R environment, but don't know how or how to undo it. The problem is this: I paste the following into R: test-function() { print(hello) } And I see this: test-function() + { + .print(hello) + } test() Error in test() : couldn't find function .print When I do

Re: [R] Programs stopped working--.print (newbie question)

2003-07-25 Thread Peter Muhlberger
On 7/25/03 5:53 PM, Spencer Graves [EMAIL PROTECTED] wrote: I see a period . before 'print' in your function definition. Might this be the problem? spencer graves The code I paste in has no . in front of 'print' . But when the code displays after I put it in, R puts a . in front of it. I

[R] Problem w/ source

2003-07-24 Thread Peter Muhlberger
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

Re: [R] Problem w/ source

2003-07-24 Thread Peter Muhlberger
Thanks to everyone for their suggestions on getting source to print! It seems not everyone was aware of a couple options that gets source to print out everything. I'm now using the following command: source(do.R, print.eval=TRUE, echo=TRUE) __ [EMAIL

[R] Hypothesis testing after optim

2003-07-14 Thread Peter Muhlberger
on the robustness of ML estimation in R! Peter Peter Muhlberger Visiting Professor of Political Science Institute for the Study of Information Technology and Society (InSITeS) Carnegie Mellon University

[R] How robust is mle in R?

2003-07-13 Thread Peter Muhlberger
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