[R] Query regarding modelling using R

2006-07-07 Thread flash johny
Hi, I am working on project to build a model for analysing Mortgage-backed securities. I am doing this as a part of my summer project. After much thought I have decided on using R for doing this modelling. One of the steps in this model is making an interest rate model to generate interest rate

[R] Crosstabs

2006-07-07 Thread Bi-Info (http://members.home.nl/bi-info)
Dear Users, I'm a complete novice to R. I need to do a crosstabs in R, but my data is almost completely alphanumeric (with some variables scaled). The Table routine does not seem to accept alphanumeric data. What should I do? Do I need to recode it? How should I do that? Thanks in advance,

Re: [R] RMySQL Suse 10.0 installing problems

2006-07-07 Thread Prof Brian Ripley
On Thu, 6 Jul 2006, H. Paul Benton wrote: Thanks again everyone, I have a problem trying to install RMySQL on Suse 10.0. I have used both the install.packages() and the 'R CMD INSTALL RMySQL... neither worked. I get the error message telling me that it cannot find mysql. So I have set

Re: [R] engineering notation format

2006-07-07 Thread Prof Brian Ripley
Both format and formatC (and sprintf) use C facilities for scientific format. As far as I know C has no facilities for your desired format, so you would need to write your own C code and interface to R. On Thu, 6 Jul 2006, Walker, Sam wrote: Hi, How can I format numbers to engineering

Re: [R] KPSS test

2006-07-07 Thread Pfaff, Bernhard Dr.
Hello Sachin, a sequential testing procedure is described in the useR! book: @Book{, title = {Analysis of Integrated and Cointegrated Time Series with R}, author = {B. Pfaff}, publisher = {Springer}, edition = {First}, address = {New York}, year = {2006}, note =

[R] Polynomial kernel in SVM in e1071 package

2006-07-07 Thread Wuming Gong
Dear list, In some places (for example, http://en.wikipedia.org/wiki/Support_vector_machine) , the polynomail kernel in SVM is written as (u'*v + 1)^d, while in the document of svm() in e1071 package, the polynomial kernel is written as (gamma*u'*v + coef0)^d. I am a little confused here: When

Re: [R] R crash with 'library(Matrix); as(x, dgCMatrix)' ...

2006-07-07 Thread Martin Maechler
JohnT == Thaden, John J [EMAIL PROTECTED] on Thu, 6 Jul 2006 12:29:42 -0500 writes: JohnT Martin Maechler replied to my query Warning while subsetting...: MartinM JohnT == Thaden, John J [EMAIL PROTECTED] MartinM on Thu, 6 Jul 2006 00:02:10 -0500 writes: JohnT ...

[R] how to name a variable?

2006-07-07 Thread zhijie zhang
Dear friends, The s in the following argument don't have a variable name, how should i give it a name? s-data.frame(seq(1,6,by=2)) s seq.1..6..by...2. 1 1 2 3 3 5 thanks very much! -- Kind Regards, Zhi Jie,Zhang ,PHD Department of

Re: [R] engineering notation format

2006-07-07 Thread Hans-Joerg Bibiko
Hi, try this: formatEng - function(x) { s-as.numeric(strsplit(format(x, scientific=T),e)[[1]]) return(paste(s[1]*10^(s[2]%%3),as.integer(s[2]-(s[2]%%3)),sep=e)) } Some examples: 1635 000 000 = 1.635E9 163 500 000 = 163.5E6 0.000 000 000 135 != 135E-9 0.000 000 000 135 =

Re: [R] how to name a variable?

2006-07-07 Thread ronggui
s-data.frame(var.name=seq(1,6,by=2)) s var.name 11 23 35 2006/7/7, zhijie zhang [EMAIL PROTECTED]: Dear friends, The s in the following argument don't have a variable name, how should i give it a name? s-data.frame(seq(1,6,by=2)) s seq.1..6..by...2. 1

Re: [R] Start Model for POLYCLASS

2006-07-07 Thread Spencer Graves
I have not seen a reply, so I will offer a few suggestions, even though I've never used the 'polspline' package. I scanned several of the help pages and looked in ~\library\polspline' where R is installed on my hard drive and found no further documentation, and I found nothing new

Re: [R] Query regarding modelling using R

2006-07-07 Thread Dieter Menne
flash johny flash.johny at gmail.com writes: Hi, I am working on project to build a model for analysing Mortgage-backed securities. I am doing this as a part of my summer project. Try http://cran.r-project.org/src/contrib/Views/ Dieter __

Re: [R] Crosstabs

2006-07-07 Thread Uwe Ligges
Bi-Info (http://members.home.nl/bi-info) wrote: Dear Users, I'm a complete novice to R. I need to do a crosstabs in R, but my data is almost completely alphanumeric (with some variables scaled). The Table routine does not seem to accept alphanumeric data. What should I do? Do I need to

Re: [R] Polynomial kernel in SVM in e1071 package

2006-07-07 Thread Uwe Ligges
Wuming Gong wrote: Dear list, In some places (for example, http://en.wikipedia.org/wiki/Support_vector_machine) , the polynomail kernel in SVM is written as (u'*v + 1)^d, while in the document of svm() in e1071 package, the polynomial kernel is written as (gamma*u'*v + coef0)^d. I am a

[R] Diverging results with SPSS

2006-07-07 Thread Celso Barros
Dear List, I apologize in advance if this is silly. I tried to replicate an analysis I did previously in SPSS using R, and was surprised to find different results. So my question is: shouldn't the following SPSS syntax REGRESSION DEPENDENT INC89 /METHOD=ENTER hiedyrs experien SE93rec. Yeld

Re: [R] Diverging results with SPSS

2006-07-07 Thread Peter Dalgaard
Celso Barros [EMAIL PROTECTED] writes: Dear List, I apologize in advance if this is silly. I tried to replicate an analysis I did previously in SPSS using R, and was surprised to find different results. So my question is: shouldn't the following SPSS syntax REGRESSION DEPENDENT

Re: [R] Diverging results with SPSS

2006-07-07 Thread Florian Koller
If results are *very* different, I would suspect that R treated experien as a factor (when you use read.spss the default is to use value labels, which makes R treat such variables as factors -- set use.value.labels = F). Another explanation could be missing data in SPSS (not sysmis, but coded

Re: [R] R-sig-foo searching, was : High breakdown/efficiency statistics -- was RE: Rosner's test

2006-07-07 Thread Romain Francois
Le 23.06.2006 10:42, Martin Maechler a écrit : {BTW: Did you know that to *search* mailing list archives of such R-SIG-foo mailing lists, you can use google very efficiently by prepending the mailing list name and 'site:stat.ethz.ch'? e.g., use google search on

[R] convert ms() to optim()

2006-07-07 Thread Xiaodong Jin
How to convert the following ms() in Splus to Optim in R? The Calc function is also attached. ms(~ Calc(a.init, B, v, off, d, P.a, lambda.a, P.y, lambda.y, 10^(-8), FALSE, 20, TRUE)$Bic, start = list(lambda.a = 0.5, lambda.y = 240), control = list(maxiter = 10, tol = 0.1))

[R] Calling R from Java

2006-07-07 Thread zana adeb
Madam, I've read your answer : /// Here are other alternatives that are easy to implement and that you should consider depending on what you want to do: 1- one is to use R in batch mode ie you create a file in your java code with all the R commands

Re: [R] engineering notation format

2006-07-07 Thread Walker, Sam
Clever... Good observation on the last example, mistake on my part. Thanks for all the suggestions. Sam -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hans-Joerg Bibiko Sent: Friday, July 07, 2006 4:27 AM To: r-help@stat.math.ethz.ch Subject: Re: [R]

[R] parametric proportional hazard regression

2006-07-07 Thread Valentin Dimitrov
Dear all, I am trying to find a suitable R-function for parametric proportional hazard regressions. The package survival contains the coxph() function which performs a Cox regression which leaves the base hazard unspecified, i.e. it is a semi-parametric method. The package Design contains the

[R] replace values in data frame

2006-07-07 Thread Wade Wall
Hi all, I have a three columned list that I have imported into R. The first column is a plot (ex. Plot1), the second is a species name (ex ACERRUB) and the third a numeric value. I want to replace some of the second column names with other names (for example replace ACERRUB with ACERDRU). The

[R] dotplot (lattice) with panel.segments and groups

2006-07-07 Thread Sebastian Luque
Hi, The following produces almost exactly what I needed. The problems are that the 'panel.dotplot' call (commented) generates the error 'Error in NextMethod([) : argument subscripts is missing, with no default'. The other problem is that the colors alternate between the levels of the 'site'

Re: [R] replace values in data frame

2006-07-07 Thread Marc Schwartz (via MN)
On Fri, 2006-07-07 at 11:20 -0400, Wade Wall wrote: Hi all, I have a three columned list that I have imported into R. The first column is a plot (ex. Plot1), the second is a species name (ex ACERRUB) and the third a numeric value. I want to replace some of the second column names with

[R] How to change the type of segments ends?

2006-07-07 Thread Lu, Jiang Jane
Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to change the type of ends by using 'lend' arguments, but cannot

Re: [R] graphlets

2006-07-07 Thread Liaw, Andy
Naras presented something with similar functionalities using SVG a couple of years ago, and since then the svgdevice package had been made available. I do not know SVG myself, but according to Naras, it's all possible. Best, Andy From: Terry Therneau I have an application where the Splus

Re: [R] Diverging results with SPSS

2006-07-07 Thread Celso Barros
Dear Peter and Florian, I think you have spotted the problem, thank you very much. I checked the frequencies, and R is not understanding that the (-1) value in a binary variable was defined in SPSS as sysmis. This was precisely the variable that showed the larger difference (it's the only

Re: [R] parametric proportional hazard regression

2006-07-07 Thread Thomas Lumley
On Fri, 7 Jul 2006, Valentin Dimitrov wrote: I am trying to find a suitable R-function for parametric proportional hazard regressions. The package survival contains the coxph() function which performs a Cox regression which leaves the base hazard unspecified, i.e. it is a semi-parametric

Re: [R] parametric proportional hazard regression

2006-07-07 Thread Hamilton, Cody
Valentin, Have you tried survreg() in the Design library? Regards, -Cody -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Valentin Dimitrov Sent: Friday, July 07, 2006 10:1 AM To: r-help@stat.math.ethz.ch Subject: [R] parametric proportional hazard

[R] Rpad Server Installation on Windows XP

2006-07-07 Thread Minjeong Ahn
Hello, I have a question about Rpad Server Installation on Windows XP. Here is a guide http://www.rpad.org/Rpad/ServerNotes.html and I have been reading this more than ten times to figure this out, but still having trouble executing a Rpad website properly. Problem: for example, if I go

Re: [R] How to change the type of segments ends?

2006-07-07 Thread Marc Schwartz (via MN)
On Fri, 2006-07-07 at 11:47 -0400, Lu, Jiang Jane wrote: Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to

Re: [R] How to change the type of segments ends?

2006-07-07 Thread Prof Brian Ripley
You need angle=90. From the help page: angle: angle from the shaft of the arrow to the edge of the arrow head. On Fri, 7 Jul 2006, Lu, Jiang Jane wrote: Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal

Re: [R] How to change the type of segments ends?

2006-07-07 Thread Chuck Cleland
Lu, Jiang Jane wrote: Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to change the type of ends by using

Re: [R] dotplot (lattice) with panel.segments and groups

2006-07-07 Thread Gabor Grothendieck
It seems to work if you handle the col= argument explicitly. Suggest you double check this since I have not carefully done so: barley$yield2 - with(barley, yield + 5) dotplot(site ~ yield | variety, data=barley, groups=year, yield2=barley$yield2, col=c(gray, black),

Re: [R] How to change the type of segments ends?

2006-07-07 Thread Gavin Simpson
On Fri, 2006-07-07 at 11:47 -0400, Lu, Jiang Jane wrote: Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to

Re: [R] How to change the type of segments ends?

2006-07-07 Thread Lu, Jiang Jane
Thank you all for such a prompt response. I misunderstood the meaning of 'lend' in par(). Now I have got the ideal confidence segments. I appreciate all the specific explanations you have offered. Sincerely, Jane -Original Message- From: Gavin Simpson [mailto:[EMAIL PROTECTED] Sent:

Re: [R] replace values in data frame

2006-07-07 Thread Wade Wall
The format is like this. Plot species Value P1 ACERRUB 3 P2 MAGNVIR2 P3 ARONARB 2 etc. imported using x-read.table(file=filename.txt) I want to replace a list of values in the 2nd column with another list. For example, I want to replace ARONARB with PHOTPYR.

[R] Converting data frame to zoo

2006-07-07 Thread Horace Tso
Dear list, I know this is really basic question but I just couldn't get anything to work. (I did a R site search with keywords zoo and data frame but the server timed out on me.) I have a time series which has the following (typical) format, DATE Open High Low

Re: [R] replace values in data frame

2006-07-07 Thread Marc Schwartz (via MN)
Thanks for re-posting onlist. My offlist reply: The 'list' argument, as per ?replace, needs to be a vector of one or more indices into another vector, generally the source vector argument 'x', not the actual values that you want to replace. 'list' can either be explicit integers as the indices,

Re: [R] Converting data frame to zoo

2006-07-07 Thread Gabor Grothendieck
Check out read.zoo in the zoo package. On 7/7/06, Horace Tso [EMAIL PROTECTED] wrote: Dear list, I know this is really basic question but I just couldn't get anything to work. (I did a R site search with keywords zoo and data frame but the server timed out on me.) I have a time series

Re: [R] replace values in data frame

2006-07-07 Thread Marc Schwartz (via MN)
Wade, Given that you appear to have multiple search and replace items to deal with, here is a possible loop based Global Search and Replace solution: gsr - function(Source, Search, Replace) { if (length(Search) != length(Replace)) stop(Search and Replace Must Have Equal Number of Items\n)

Re: [R] Rpad Server Installation on Windows XP

2006-07-07 Thread roger bos
Claire, I know you emailed me a question earlier and I just haven't gotten around to answering it. For both perl and rgui.exe (and rterm.exe) your path needs to state the location of these files. (I am not sure about this, but after you change the path you may even need to reboot for the change

[R] attach and detach question

2006-07-07 Thread markleeds
I have a large R program that I am constantly running over and over again. At the beginning of this program, I create a hige matrix and a huge dataframe but these are constant. What I mean by constant is that, if I run the program over later, I really should just use the old matrix and

Re: [R] Converting data frame to zoo

2006-07-07 Thread Horace Tso
Thanks Gabor. I figured out what went wrong. The culprit turns out to be the headers in my data. read.zoo doesn't recognize column headers and complains Error in read.zoo(C:\\...\\table.csv, : index contains NAs Or is there an option as in read.table(x, header=...) ? After the

Re: [R] Converting data frame to zoo

2006-07-07 Thread Gabor Grothendieck
read.zoo supports all the arguments that read.table supports including header=. From the read.zoo help file: ...: further arguments passed to 'read.table'. Regards. On 7/7/06, Horace Tso [EMAIL PROTECTED] wrote: Thanks Gabor. I figured out what went wrong. The culprit turns out to be the

Re: [R] attach and detach question

2006-07-07 Thread Gabor Grothendieck
There is an example of saving just two objects in the example section of ?save To check whether an object of a given name exists see ?exists On 7/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a large R program that I am constantly running over and over again. At the beginning of

Re: [R] attach and detach question

2006-07-07 Thread Chuck Cleland
[EMAIL PROTECTED] wrote: I have a large R program that I am constantly running over and over again. At the beginning of this program, I create a hige matrix and a huge dataframe but these are constant. What I mean by constant is that, if I run the program over later, I really should just

[R] Levels and GLM

2006-07-07 Thread justin rapp
I am using the as.factor command to use with glm. When I use the command maj - as.factor(data.logistic$Majors) maj I receive the following output: [1] M M N M M M M N N M M M N M M M M M M M M M M M N M N N M M N M M N M M M M M [40] N M N M M N M M M N M N M N M N N N M N M M M M M M N M N

Re: [R] [R-pkgs] ggplot: a new system for drawing graphics in R

2006-07-07 Thread Timm Danker
I think the ggplot package is extremely promising. Parts of the dokumentation are very good alread, e.g I recently managed to write my first own grob function. One thing I am missing in the dokumentation is a little more detail on how to modify the colours of a plot. Specifically, if I have:

Re: [R] attach and detach question

2006-07-07 Thread Gavin Simpson
On Fri, 2006-07-07 at 12:57 -0500, [EMAIL PROTECTED] wrote: snipped / 1) i can't find an example somewhere of just saving two objects rather than the whole session. i've looked and looked and i can't find it. ?save 2) if i am able to save these two objects, i was hoping that it would be

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

2006-07-07 Thread Spencer Graves
I'm not sufficiently familiar with 'trellis' / 'lattice' to provide an easy, complete answer to your question, but I can explain the current behavior and provide a hack to get you what you want. With luck, someone else will suggest an improvement. First, let's decompose

Re: [R] dotplot (lattice) with panel.segments and groups

2006-07-07 Thread Deepayan Sarkar
On 7/7/06, Sebastian Luque [EMAIL PROTECTED] wrote: Hi, The following produces almost exactly what I needed. The problems are that the 'panel.dotplot' call (commented) generates the error 'Error in NextMethod([) : argument subscripts is missing, with no default'. It's just as it says:

Re: [R] dotplot (lattice) with panel.segments and groups

2006-07-07 Thread Gabor Grothendieck
Could you explain what panel.groups= does and what the difference is between panel.groups= and panel= ? In ?xyplot it just says: panel.groups: useful mostly for 'xyplot' and 'densityplot'. Applies when 'panel' is 'panel.superpose' (which happens by default in these cases if

[R] Multistage Sampling

2006-07-07 Thread Mark Hempelmann
Dear WizaRds, dear Thomas, First of all, I want to tell you how grateful I am for all your support. I wish I will be able to help others along one day the same way you do. Thank you so much. I am struggling with a multistage sampling design: library(survey) multi3 -

Re: [R] Multistage Sampling

2006-07-07 Thread markleeds
From: Mark Hempelmann [EMAIL PROTECTED] Date: Fri Jul 07 14:05:29 CDT 2006 To: r-help@stat.math.ethz.ch Subject: [R] Multistage Sampling i also find it an truly amazing group also. the general kindness and generosity of everyone is beyond belief. it will be a long time coming but i hope i can

Re: [R] dotplot (lattice) with panel.segments and groups

2006-07-07 Thread Deepayan Sarkar
On 7/7/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Could you explain what panel.groups= does and what the difference is between panel.groups= and panel= ? In ?xyplot it just says: panel.groups: useful mostly for 'xyplot' and 'densityplot'. Applies when 'panel' is

[R] FW: Levels and GLM

2006-07-07 Thread Kuhn, Max
One correction... since you are fitting a logistic model, it is technically correct to say the mean value of the linear predictor, instead of mean response. 20 lashes for me. Max -Original Message- From: Kuhn, Max Sent: Friday, July 07, 2006 4:11 PM To: 'r-help@stat.math.ethz.ch'

Re: [R] FW: Levels and GLM

2006-07-07 Thread Peter Dalgaard
Kuhn, Max [EMAIL PROTECTED] writes: One correction... since you are fitting a logistic model, it is technically correct to say the mean value of the linear predictor, instead of mean response. 20 lashes for me. ...plus five more for forgetting that the link is nonlinear and that you

Re: [R] dotplot (lattice) with panel.segments and groups

2006-07-07 Thread Gabor Grothendieck
On 7/7/06, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 7/7/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Could you explain what panel.groups= does and what the difference is between panel.groups= and panel= ? In ?xyplot it just says: panel.groups: useful mostly for 'xyplot' and

Re: [R] Multistage Sampling

2006-07-07 Thread Thomas Lumley
On Fri, 7 Jul 2006, Mark Hempelmann wrote: library(survey) multi3 - data.frame(cluster=c(1,1,1,1 ,2,2,2, 3,3), id=c(1,2,3,4, 1,2,3, 1,2), nl=c(4,4,4,4, 3,3,3, 2,2), Nl=c(100,100,100,100, 50,50,50, 75,75), M=rep(23,9), y=c(23,33,77,25, 35,74,27, 37,72) ) dmulti3 - svydesign(id=~cluster+id,

Re: [R] Harmonic Regression in R

2006-07-07 Thread Spencer Graves
Since I haven't seen an answer to this, I'll offer a couple of comments. I don't recall having heard the term 'harmonic regression' prior to seeing your email, but it sounded interesting, so I did some searching. First, RSiteSearch(harminic regression) produced 7 hits, one of which

Re: [R] Harmonic Regression in R

2006-07-07 Thread Gabor Grothendieck
I have not seen it myself (I have the first edition which uses FORTRAN) but I believe the second edition of Peter Bloomfield's book on Fourier Analysis contains harmonic regression code in S-Plus and that may work in R. On 7/7/06, Spencer Graves [EMAIL PROTECTED] wrote: Since I haven't

[R] KhmaladzeTest

2006-07-07 Thread raul sanchez
Hello. I am a beginer in R and I can not implement the KhmaladzeTest in the following command. Please help me!!! PD: I attach thw results and the messages of the R program R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) ISBN 3-900051-07-0

Re: [R] parametric proportional hazard regression

2006-07-07 Thread Valentin Dimitrov
Those are not proportional hazards families of distributions. That is, if the distribution is gaussian for one value of the hazard ratio parameters it will not be gaussian for any other value. You can get accelerated failure models with these distributions using survreg() in the

Re: [R] parametric proportional hazard regression

2006-07-07 Thread Valentin Dimitrov
Cody, I have tried the survreg() in the Design library, it is analogous to survreg() in the survival library and it seems to me it is designed only for accelerated time models like the accelerated failure model (or accelerated lifetime model) and not for proportional hazard models. Correct me if

Re: [R] Problems when computing the 1rst derivative of mixtures of densities

2006-07-07 Thread Spencer Graves
What problem are you trying to solve? The mixture proportion you are trying to estimate violates the assumptions that provide a normal approximation to the distribution of maximum likelihood estimators. These situations even violate the assumptions for 2*log(likelihood ratio) being

Re: [R] parametric proportional hazard regression

2006-07-07 Thread Frank E Harrell Jr
Valentin Dimitrov wrote: Those are not proportional hazards families of distributions. That is, if the distribution is gaussian for one value of the hazard ratio parameters it will not be gaussian for any other value. You can get accelerated failure models with these distributions

Re: [R] parametric proportional hazard regression

2006-07-07 Thread Frank E Harrell Jr
Valentin Dimitrov wrote: Cody, I have tried the survreg() in the Design library, it is analogous to survreg() in the survival library and it seems to me it is designed only for accelerated time models like the accelerated failure model (or accelerated lifetime model) and not for

[R] heteroskedastic ordered probit

2006-07-07 Thread Rendas-Baum, Regina
Dear all, is there existing code to fit a ordinal regression model with probit link where the variance can be modeled? For example, the polr function from the MASS package fits: probitP(Y = k | x) = zeta_k - eta Instead of, probitP(Y = k | x) = (zeta_k - eta)/scale, where scale = exp(b*z)