[R] problems with simple statistical procedures

2006-07-02 Thread Thomas Preuth
Hello, I use an imported dataframe and want to extract the mean value for one column. after typing mean (rae.df$VOL_DEP) I receive [1] NA Warning message: Argument ist weder numerisch noch boolesch: gebe NA zurück in: mean.default(rae.df$POINT_Y_CH) But when i look into the dataframe the

[R] workaround for numeric problems

2006-07-02 Thread Ott Toomet
Dear R-people, I have to compute C - -(pnorm(B)*dnorm(B)*B + dnorm(B)^2)/pnorm(B)^2 This expression seems to be converging to -1 if B approaches to -Inf (although I am unable to prove it). R has no problems until B equals around -28 or less, where both numerator and denominator go to 0 and

Re: [R] replace values?

2006-07-02 Thread Jonathan Baron
On 07/02/06 12:39, zhijie zhang wrote: Dear friends, i have a dataset like this: x y z 1 2 3 2 3 1 3 2 1 1 1 3 2 1 2 3 2 3 2 1 1 I want to replace x with the following values:1-a,2-b,3-c,4-d; replace y with the following values:1-b,2-a,3-c,4-d; replace z

Re: [R] replace values?

2006-07-02 Thread Matthias Braeunig
# reproducing your example xx-x y z + 1 2 3 + 2 3 1 + 3 2 1 + 1 1 3 + 2 1 2 + 3 2 3 + 2 1 1 # you did not tell us the class of your data, assuming data.frame df-read.table(textConnection(xx),header=T,colClasses=factor) # a clean way to do what you want is using factors with ?levels # (note that

Re: [R] workaround for numeric problems

2006-07-02 Thread Dimitrios Rizopoulos
I'd compute this in the log-scale (taking also advantage of the 'log' and 'log.p' arguments of dnorm() and pnorm(), respectively), and then transform back, e.g., fn1 - function(B){ -(pnorm(B) * dnorm(B) * B + dnorm(B)^2)/pnorm(B)^2 } fn2 - function(B){ p1 - dnorm(B, log = TRUE) +

Re: [R] Optional variables in function?

2006-07-02 Thread jim holtman
?missing On 7/2/06, Jonathan Greenberg [EMAIL PROTECTED] wrote: I'm a bit new to writing R functions and I was wondering what the best practice for having optional variables in a function is, and how to test for optional and non-optional variables? e.g. if I have the following function:

[R] how to recode in my dataset?

2006-07-02 Thread zhijie zhang
Dear Rusers, My question is about recode variables. First, i'd like to say something about the idea of recoding: My dataset have three variables:type,soiltem and airtem,which means grass type, soil temperature and air temperature. As we all known, the change of air temperature is greater than

[R] sparse matrix tools

2006-07-02 Thread Thaden, John J
Dear R-Help list: I'm using the Matrix library to operate on 600 X ~5000 element unsymmetrical sparse arrays. So far, so good, but if I find I need more speed or functionality, how hard would it be to utilize other sparse matrix toolsets from within R, say MUMPS, PARDISO or UMFPACK, that do

Re: [R] problems with simple statistical procedures

2006-07-02 Thread Uwe Ligges
Thomas Preuth wrote: Hello, I use an imported dataframe and want to extract the mean value for one column. after typing mean (rae.df$VOL_DEP) I receive [1] NA Warning message: Argument ist weder numerisch noch boolesch: gebe NA zurück in: mean.default(rae.df$POINT_Y_CH) Well,

Re: [R] send output to printer

2006-07-02 Thread Uwe Ligges
Matthias Braeunig wrote: It has to be a simple thing, but I could not figure it out: How do I send the text output from object x to the printer? As a shell user I would expect a pipe to the printer... |kprinter or |lpr -Pmyprinter somehow. And yes, I'm on Linux. I think capture.output()

Re: [R] nlme: correlation structure in gls and zero distance

2006-07-02 Thread Patrick Giraudoux
Joris De Wolf a écrit : Have you tried to define 'an' as a group? Like in gls(IKAfox~an,correlation=corExp(2071,form=~x+y|an,nugget=1.22),data=renliev) A small data set might help to explain the problem. Joris Thanks. Seems to work with a small artificial data set:

[R] large dataset!

2006-07-02 Thread JENNIFER HILL
Hi, I need to analyze data that has 3.5 million observations and about 60 variables and I was planning on using R to do this but I can't even seem to read in the data. It just freezes and ties up the whole system -- and this is on a Linux box purchased about 6 months ago on a dual-processor PC

Re: [R] curiosity question: new graphics vs. old graphics subsystem

2006-07-02 Thread Mihai Nica
Well, as a newbee, I believe your idea is great. However, the R Core team is, in my humble opinion, way too stretched (for a free software development team) to do this. A complementary development team (similar to, say, the Tinn-R team) might be able to address this issue. I wish I would have

Re: [R] how to recode in my dataset?

2006-07-02 Thread Dimitrios Rizopoulos
probably ?cut() is what you're looking for, e.g., something like: ind - cut(mydata$soiltem, seq(0, 60, 0.2), labels = FALSE) seq(0.1, 60, 0.2)[ind] I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of

Re: [R] large dataset!

2006-07-02 Thread Andrew Robinson
Jennifer, it sounds like that's too much data for R to hold in your computer's RAM. You should give serious consideration as to whether you need all those data for the models that you're fitting, and if so, whether you need to do them all at once. If not, think about pre-processing steps, using

[R] how to get the studentized residuals in lm()

2006-07-02 Thread zhijie zhang
Dear friends, In s-plus, lm() generates the the studentized residuals automatically for us, and In R, it seems don't have the results: After i fitted lm(), i use attibutes() to see the objects and didn't find studentized residuals . How to get the the studentized residuals in lm(),have i missed

Re: [R] large dataset!

2006-07-02 Thread miguel manese
Hello Jennifer, I'm writing a package SQLiteDF for Google SOC2006, under the supervision of Prof. Bates Prof. Riley. Basically, it stores data frame into sqlite databases (i.e. in a file) and aims to be transparently accessible to R using the same operators for ordinary data frames. Right now,

Re: [R] panel ordering in nlme and augPred plots

2006-07-02 Thread Nathaniel Derby
Hi, I'm new at this, I'm very confused, and I think I'm missing something important here. In our pet example we have this: fm - lme(Orthodont) plot(Orthodont) plot(augPred(fm, level = 0:1)) which gives us a trellis plot with the females above the males, starting with F03, F04, F11, F06,

Re: [R] how to get the studentized residuals in lm()

2006-07-02 Thread ronggui
help.search(studentized) You will see: studres(MASS) Extract Studentized Residuals from a Linear Model 2006/7/3, zhijie zhang [EMAIL PROTECTED]: Dear friends, In s-plus, lm() generates the the studentized residuals automatically for us, and In R, it seems don't have the results:

Re: [R] how to recode in my dataset?

2006-07-02 Thread ronggui
I always use recode function (in the car packages) to recode variables.That works well and I like that function. 2006/7/2, zhijie zhang [EMAIL PROTECTED]: Dear Rusers, My question is about recode variables. First, i'd like to say something about the idea of recoding: My dataset have three

Re: [R] Data Manipulations - Group By equivalent

2006-07-02 Thread ronggui
use doBy package will be more easy. # GENERATE A TREATMENT GROUP # group-as.factor(paste(treatment, rep(1:2, 4), sep = '_')); # CREATE A SERIES OF RANDOM VALUES # x-rnorm(length(group)); # CREATE A DATA FRAME TO COMBINE THE ABOVE TWO # data-data.frame(group, x); library(doBy)

[R] Query : Chi Square goodness of fit test

2006-07-02 Thread priti desai
If we have the data base of frauds given below no. of frauds = variable variable -c(4,1,6,9,9,10,2,4,8,2,3,0,1,2,3,1,3,4,5,4,4,4,9,5,4,3,11,8,12,3,10,0, 7) pmf - dpois(i, lambda, log = FALSE) # prob. mass function of variable How to apply chi-square goodness of fit to test, Sample coming

[R] Problem with try()

2006-07-02 Thread Landsman Leonid
Dear R-experts, I am running a large simulation exercise where the enough complicated integration is required. The integral is computed within a C-function called Denom by use of function qags from the gsl library. Here is a piece of R-code: