Re: [R] Functions in R like lincom and nlcom of Stata

2008-12-14 Thread Prof Brian Ripley
On Sat, 13 Dec 2008, Stas Kolenikov wrote: Those commands provide point estimates, standard errors and confidence intervals based on linear combination of parameters or linearization/delta-method, respectively. R's contrasts appear to be limited to a single factor and combinations that sum up

Re: [R] Standard error of mean for aov

2008-12-14 Thread JS . Augustyn
Thanks for all of your help, David, I finally got it. Here's some generic syntax in case it helps someone else down the road (using a 4-way ANOVA with repeated measures on all factors): # LOAD DATA data - read.table(PATH\\datafile.txt) # RUN THE ANOVA data.aov - aov(y ~

Re: [R] How-To capture and handle errors with R

2008-12-14 Thread Bernardo Rangel Tura
On Fri, 2008-12-12 at 12:51 +0100, mau...@alice.it wrote: The following error occurs every now and then by calling a function of wmTSA package: Error in `row.names-.data.frame`(`*tmp*`, value = c(1, 0)) : invalid 'row.names' length I would greatly appreciate some guidelines about how

Re: [R] Hidden Markov Models.

2008-12-14 Thread Dieter Menne
Marcus Vinicius mvinic at gmail.com writes: Is there anyone that may send me articles, e-books or scripts (R/Matlab) about Hidden Markov Models? You get a lot by searching R-project with the term Hidden Markov, including a package with that name. Dieter

Re: [R] How can we predict differences in a slope, given that the random component was significant?

2008-12-14 Thread Dieter Menne
Sachi Ito wrote: Using R lme function, I found that both fixed and random effects of variable A on variable B are significant. It would be good if you could tell us how you found out that the random effects were significant. I must have missed something here. Sachi Ito wrote:

[R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Tanmoy Talukdar
I have two assignment problems... I have written this small code for regression with two regressors . n - 50 x1 - runif(n,1,10) x2 - x1 + rnorm(n,0,0.5) plot(x1,x2) # x1 and x2 strongly correlated cor(x1,x2) y - 3 + 0.5*x1 + 1.1*x2 + rnorm(n,0,2) intact.lm - lm(y ~ x1 + x2) summary(intact.lm)

Re: [R] [Rd] gregexpr - match overlap mishandled (PR#13391)

2008-12-14 Thread Wacek Kusnierczyk
Greg Snow wrote: Controlling the pointer is going to be very different from perl since the R functions are vectorized rather than focusing on a single string. Here is one approach that will give all the matches and lengths (for the original problem at least): mystr - paste(rep(1122,

[R] Help - java.library.path

2008-12-14 Thread Stefan Gengenbach
Hello all, I`m a computer science student from Frankfurt/main (germany). Our student team (10 students) are working on a R/Interface project (Java and R) and we have a problem with R and JRI. We are working on 10 computers with Windows XP SP2, R 2.8.0, jdk1.6.0_11 and the same classpath

Re: [R] Avoiding multiple outputs using RODBC package

2008-12-14 Thread Mark Wardle
Hi. You don't need to download the whole of the output database table to look for an already generated answer. You can write a SQL query to do that instead. ie. give me any rows with these parameters... Get the database to do the work - it is what they are designed to do. So the procedure is:

[R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Tanmoy Talukdar
[sorry for the repost. I forgot to switch off formatting last time] I have two assignment problems... I have written this small code for regression with two regressors . n - 50 x1 - runif(n,1,10) x2 - x1 + rnorm(n,0,0.5) plot(x1,x2) # x1 and x2 strongly correlated cor(x1,x2) y - 3 + 0.5*x1 +

[R] Help required to install package from a website

2008-12-14 Thread Eamonn O'Brien
Hi, I am new to R and I'm looking to perform some method comparison analysis and would be grateful for some help regarding package installation. There is a package 'MethComp' that I want to use (http://staff.pubhealth.ku.dk/~bxc/MethComp/Courses/Sthm.2007/.) Unfortunately I am unable to install

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Duncan Murdoch
On 14/12/2008 9:40 AM, Tanmoy Talukdar wrote: [sorry for the repost. I forgot to switch off formatting last time] I have two assignment problems... I have written this small code for regression with two regressors . n - 50 x1 - runif(n,1,10) x2 - x1 + rnorm(n,0,0.5) plot(x1,x2) # x1 and x2

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread David Winsemius
On Dec 14, 2008, at 9:40 AM, Tanmoy Talukdar wrote: [sorry for the repost. I forgot to switch off formatting last time] I have two assignment problems... I have written this small code for regression with two regressors . For replication purposes, it might be good to set a seed for the

Re: [R] Help required to install package from a website

2008-12-14 Thread Ben Bolker
Eamonn O'Brien wrote: Hi, I am new to R and I'm looking to perform some method comparison analysis and would be grateful for some help regarding package installation. There is a package 'MethComp' that I want to use (http://staff.pubhealth.ku.dk/~bxc/MethComp/Courses/Sthm.2007/.)

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Tanmoy Talukdar
Why do you think that running lm() twice on those two models is going to help me? They are identical models and hence we get identical results.The second question is now alright. I had some misunderstanding about it. Please tell me if you can find any downside in summary (). I can't find any.

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Tanmoy Talukdar
Why do you think that running lm() twice on those two models is going to help me? They are identical models and hence we get identical results.The second question is now alright. I had some misunderstanding about it. Please tell me if you can find any downside in summary (). I can't find any.

Re: [R] Help required to install package from a website

2008-12-14 Thread Eamonn O'Brien
Thanks Ben Successfully installed. On Sun, Dec 14, 2008 at 2:59 PM, Ben Bolker bol...@ufl.edu wrote: Eamonn O'Brien wrote: Hi, I am new to R and I'm looking to perform some method comparison analysis and would be grateful for some help regarding package installation. There is a package

Re: [R] Functions in R like lincom and nlcom of Stata

2008-12-14 Thread John Fox
Dear Stas and David, A couple of people have mentioned linear.hypothesis() in the car package, which has methods for several kinds of models and a default method that will work for any model that responds to coef() and vcov(). The delta.method() function in the alr3 package is similarly general.

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Tanmoy Talukdar
running anova() on intact12 and intact 21 gives two different results!! anova(intact12) Analysis of Variance Table Response: y Df Sum Sq Mean Sq F valuePr(F) x1 1 663.18 663.18 203.065 2.2e-16 *** x2 1 35.21 35.21 10.781 0.001940 ** Residuals 47 153.49

[R] error with sqldf v0-1.4

2008-12-14 Thread martin trobec
I'm getting an error message when using the new version of sqldf, library(sqldf) str(kdv) 'data.frame': 71 obs. of 3 variables: $ dpss: num 0.117 0.144 0.164 0.166 0.165 ... $ npdp: num 0.1264 0.0325 0.0109 0.0033 0.0055 ... $ logk: num 1.12 1.29 1.41 1.41 1.42 ... test=sqldf(select

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Tanmoy Talukdar
anyone please explain why this happens.. I know this happens when x1 and x2 has different sizes. but here x1 and x2 have same dimension. On Sun, Dec 14, 2008 at 9:26 PM, Tanmoy Talukdar tanmoy.taluk...@gmail.com wrote: running anova() on intact12 and intact 21 gives two different results!!

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread hadley wickham
anyone please explain why this happens.. I know this happens when x1 and x2 has different sizes. but here x1 and x2 have same dimension. Given that this is a homework problem, I think the onus is on you to figure this out, not on us to help you. In almost all classes, you are expected to work

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Tanmoy Talukdar
I think now I have got some understanding of the things. y ~ x1+x2 first adds x1 to the model and then adds x2 . But y~x2+x1 adds x2 first, so the value we get are different. please correct me if i am wrong. On Sun, Dec 14, 2008 at 9:48 PM, hadley wickham h.wick...@gmail.com wrote: anyone

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Ben Bolker
Tanmoy Talukdar wrote: I think now I have got some understanding of the things. y ~ x1+x2 first adds x1 to the model and then adds x2 . But y~x2+x1 adds x2 first, so the value we get are different. please correct me if i am wrong. You are not wrong. However, you're wearing out

Re: [R] error with sqldf v0-1.4

2008-12-14 Thread Gabor Grothendieck
I can't reproduce this. Make sure you are using the same version of sqldf as shown below, try it in a fresh session and if you still get an error provide the data in reproducible form using dput, i.e. dput(kdv) kdv - data.frame( + dpss = c(0.117, 0.144, 0.164, 0.166, 0.165), + npdp =

[R] Sweave/Rweave and results=verbatim

2008-12-14 Thread Oliver Bandel
Hello, in a Rnw-file I have this used stuff to try out tex-results... == = texme - function() cat( {\\bf Hallo, das ist voll fett!}\n ) @ results=verbatim= texme() @ == I used this command: R CMD Sweave example.Rnw and got this error:

Re: [R] Sweave/Rweave and results=verbatim

2008-12-14 Thread Matthias Kohl
it should work without quotes; i.e., results = verbatim hth, Matthias Oliver Bandel wrote: Hello, in a Rnw-file I have this used stuff to try out tex-results... == = texme - function() cat( {\\bf Hallo, das ist voll fett!}\n ) @ results=verbatim= texme() @

[R] how to convert factors to numbers

2008-12-14 Thread doloop
Hello, I am relatively new to using R. I am using R version 2.8.0. I have a program that downloads stock data from Yahoo! Finance and stores it to a text file on my hard drive. The text file contains the date, opening price, high price, low price, closing price, volume and adjusted price

Re: [R] error with sqldf v0-1.4

2008-12-14 Thread martin trobec
Gabor Grothendieck wrote: I can't reproduce this. Make sure you are using the same version of sqldf as shown below, try it in a fresh session and if you still get an error provide the data in reproducible form using dput, i.e. dput(kdv) Hi Gabor Please find attached the kdv.dat

Re: [R] Sweave/Rweave and results=verbatim

2008-12-14 Thread Oliver Bandel
Hello Matthias, Zitat von Matthias Kohl matthias.k...@stamats.de: it should work without quotes; i.e., results = verbatim hth, [...] Yes, this helps! Thanks a lot! :) Ciao, Oliver __ R-help@r-project.org mailing list

Re: [R] how to convert factors to numbers

2008-12-14 Thread Duncan Murdoch
On 14/12/2008 12:38 PM, doloop wrote: Hello, I am relatively new to using R. I am using R version 2.8.0. I have a program that downloads stock data from Yahoo! Finance and stores it to a text file on my hard drive. The text file contains the date, opening price, high price, low price, closing

Re: [R] Functions in R like lincom and nlcom of Stata

2008-12-14 Thread Thomas Lumley
On Sun, 14 Dec 2008, John Fox wrote: Dear Stas and David, A couple of people have mentioned linear.hypothesis() in the car package, which has methods for several kinds of models and a default method that will work for any model that responds to coef() and vcov(). The delta.method() function in

Re: [R] how to convert factors to numbers

2008-12-14 Thread Gabor Grothendieck
Also you might want to use read.zoo from the zoo package which will read the file in and will convert the dates at the same time into a zoo object. Something like: library(zoo) z - read.zoo(myfile.csv, header = TRUE, sep = ,, format = %m/%d/%Y) Or rather than creating files you may wish to use

[R] Output mlogit package (multinomial logisti c regression)‏

2008-12-14 Thread Tryntsje Wesselius
Hello, For my master thesis I conducted a conjoint analysis. Using the mlogit-package of Yves Croissant I should be able to analyse my choice data. I read the whole program of mlogit, but I do not understand how my coefficients must be interpreted. Are they a result of P(Y=i) or are they

Re: [R] error with sqldf v0-1.4

2008-12-14 Thread martin trobec
Gabor Grothendieck wrote: Hi, I still can't reproduce this even with your entire data set. Note that your output indicates it was not done in a fresh session as your old session was loaded first: [Previously saved workspace restored] Please try it again in a fresh session by

Re: [R] Hidden Markov Models

2008-12-14 Thread gschultz
I have found the following helpful: http://www.ai.mit.edu/courses/6.867-f02/papers/rabiner.pdf http://vision.ai.uiuc.edu/dugad/ and click on HMM Tutorial. Hope they help. -- Grant D. Schultz Senior Software Engineer ScriptPro 5828 Reeds Road Mission, KS 66202 Date: Sat, 13 Dec 2008 22:15:13

[R] [R-pkgs] New version of ggplot2, 0.8.1

2008-12-14 Thread hadley wickham
ggplot2 ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and avoid bad parts. It takes care of many of the fiddly details that make plotting a hassle

Re: [R] error with sqldf v0-1.4

2008-12-14 Thread Gabor Grothendieck
On Sun, Dec 14, 2008 at 2:53 PM, martin trobec trobecgeologygr...@shaw.ca wrote: Gabor Grothendieck wrote: Hi, I still can't reproduce this even with your entire data set. Note that your output indicates it was not done in a fresh session as your old session was loaded first:

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread John Sorkin
Ben, You were quite correct to indicate that Tanmoy should not use the listserver to get answers to his class assignments. Never the less, I do have some sympathy for him. The help pages for the R functions summary, anova, drop1, do not discuss the critically important issue addressed by

Re: [R] Rpad graphics

2008-12-14 Thread Paul Hiemstra
Ista Zahn schreef: I'm not sure this is the appropriate forum--please let me know if I should post somewhere else. I have Rpad version 1.3.0 set up on my webserver. It works, except that graphics are not displayed. They are created (i.e., when I run the example I see that graphics files are

Re: [R] Some clarificatins of anova() and summary ()

2008-12-14 Thread Gabor Grothendieck
Although not as good as putting it in the help pages there is an R wiki that anyone can add to: http://wiki.r-project.org On Sun, Dec 14, 2008 at 5:04 PM, John Sorkin jsor...@grecc.umaryland.edu wrote: Ben, You were quite correct to indicate that Tanmoy should not use the listserver to get

[R] Complex demodulation [SEC=UNCLASSIFIED]

2008-12-14 Thread Augusto.Sanabria
I am trying to complex demodulate a time-series data (eg geomagnetic field time series) at different frequencies. I wonder whether there is an R package implementing the complex demodulation method. Any information about this would be greatly appreciated. Regards, Augusto

Re: [R] Rpad graphics

2008-12-14 Thread Ista Zahn
Thanks so much for responding. I should have replied to myself and reported my solution to the problem. For some reason Rpad was looking for the image files in Rpad/Rpad/server/ddxx when it should have been looking in Rpad/server/ddxx. I fixed it just by soft linking the Rpad into itself

[R] opening a PDF document

2008-12-14 Thread Dennis Fisher
Colleagues, I am interesting in opening a PDF document via the command line from both Windows, OS X, and Linux ( R version 2.8.0). I found a command openPDF in Biobase. However, I would rather execute the command myself. For example, in OS X: system(open filename.pdf) is

Re: [R] Rpad graphics

2008-12-14 Thread David Winsemius
I realize that the attached tiff file demonstrating that the Rpad server in question *does* display graphical output (the lognormal density and a green Kiwi volcano that the default code on teh server input boxes) will be scrubbed by the mail server, but it should end up intact at Zahn's

Re: [R] opening a PDF document

2008-12-14 Thread markleeds
i guess it depends on what you have installed on your linux OS but xpdf works for me. i use fedora. On Sun, Dec 14, 2008 at 7:18 PM, Dennis Fisher wrote: Colleagues, I am interesting in opening a PDF document via the command line from both Windows, OS X, and Linux ( R version 2.8.0).

Re: [R] opening a PDF document

2008-12-14 Thread hadley wickham
On Sun, Dec 14, 2008 at 6:18 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, I am interesting in opening a PDF document via the command line from both Windows, OS X, and Linux ( R version 2.8.0). I found a command openPDF in Biobase. However, I would rather execute the command

[R] how to create duplicated ID in multi-records per subject dataset

2008-12-14 Thread Zhixin Liu
Hi R helpers, If I have a dataset looks like: ID record 120 . 30 . 25 2 26 . 15 3 21 4. And I want it becomes ID record 120 130 125 2 26 215 3 21 4.

Re: [R] how to create duplicated ID in multi-records per subject dataset

2008-12-14 Thread markleeds
hi: change your dots to NAs and then use na.locf in the zoo package. i didn't test it but i think that should work. DF$ID[DF$ID == .]-NA DF$ID-na.locf(DF$ID) On Sun, Dec 14, 2008 at 8:56 PM, Zhixin Liu wrote: Hi R helpers, If I have a dataset looks like: ID record 120 .

Re: [R] how to create duplicated ID in multi-records per subject dataset

2008-12-14 Thread andrew
if the records are in the file dupIDs.txt, then when you read them in, the IDs become factors. Coercing them to numeric gets them to assign a unique number to each factor. So, you could try the following: dupIDs - read.table(dupIDs.txt, header = T) dupIDs$ID2 - cummax(as.numeric(dupIDs$ID)-1)

Re: [R] how to create duplicated ID in multi-records per subject dataset

2008-12-14 Thread markleeds
andrew has a point which makes my solution wrong. you'd have to change the factors to numerics and I'm not sure what would happen when you did that. if you want to send a sample file of your data, that would be best but andrew's suggestion may work right off the bat. On Sun, Dec 14, 2008 at

[R] Plese share the other example data using b-spline regression

2008-12-14 Thread zenki
Hai my friend, Is there any have example data, besides in help pages for package splines ,for i am using in b-spline basis for polynomial spline? please share it to me. I need data for make me understanding it in R language environment. thank u. zenki -- View this message in context:

[R] Pearson Correlation Speed

2008-12-14 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to calculate Pearson correlation coefficients for a large matrix of size 18563 x 18563. The following function takes about XX minutes to complete, and I'd like to do this calculation about 15 times and so speed is some what of an issue.