Re: [R] Overlay cdf

2009-05-12 Thread Bill.Venables
Here are some ideas you might like to consider par(mar = c(5,4,2,4)+0.1, yaxs = "r") Sample <- rgamma(1000,2.5,.8) hist(Sample, main = "", freq = FALSE, ylim = c(0,1)) pu <- par("usr")[1:2] x <- seq(pu[1], pu[2], len = 5000) y <- pgamma(x, 2.5, 0.8) par(new = TRUE) plot(x, y, type = "l", axes = F

[R] Help with reshape/reShape and indexing

2009-05-12 Thread Dana Sevak
Dear R Helpers, I have trouble applying reShape and reshape although I read the documentation and several posts, so I would very much appreciate your help on the two points below. I have a dataframe df = data.frame(Name=c("a", "a", "a", "b", "b", "c"), X1=c("12", "13", "14", "20", "25", "30"

[R] Overlay cdf

2009-05-12 Thread beetle2
Hi, Is it possible to overlay a cummulative distribution function on a histogram of a gamma distribuition. I have a gamma function Sample = rgamma(1000,2.5,.8)+1.5 hist(Sample) regards -- View this message in context: http://www.nabble.com/Overlay-cdf-tp23515551p23515551.html Sent from th

Re: [R] Specifying data type when creating a dataframe using RODBC

2009-05-12 Thread Prof Brian Ripley
On Tue, 12 May 2009, Mark Na wrote: H R-helpers, I am using the following code to make a dataframe from an Excel spreadsheet: library(RODBC) channel <- odbcConnectExcel("Spreadsheet.xls") Data <- sqlFetch(channel, "Tab1") odbcClose(channel) One column (several, actually) in the spreadsheet co

Re: [R] maxLik package

2009-05-12 Thread spencerg
I don't understand. The help page for "maxLik" says that if the "grad" argument is 'NULL', "numeric gradient will be used." If this does not answer your question, please read the posting guide "www.R-project.org/posting-guide.html" and provide commented, minimal, self-contained, r

[R] plotting a grid with color on a map

2009-05-12 Thread dxc13
Hi all, I have posted similar questions regarding this topic, but I just can't seem to get over the hump and find a straightforward way to do this. I have attached my file as a reference. Basically, the attached file is a 5 degree by 5 degree grid of the the world (2592 cells), most of them are N

[R] creating a postscript file with two xyplots

2009-05-12 Thread Liati
Hi, I would like to create one postscript file with two different xyplots (which use different datasets). Is there a (relitively easy) way to do this? Many thanks!!! Liat. -- View this message in context: http://www.nabble.com/creating-a-postscript-file-with-two-xyplots-tp23515202p23515202.html

Re: [R] Beyond double-precision?

2009-05-12 Thread Warren Young
joaks1 wrote: I need to perform some calculations with some extremely small numbers The R package Brobdingnag does this. It uses logarithmic representation, as recommended by others in this thread, but wraps it all up for you in a custom numeric class so you can use them as any other numeri

Re: [R] plotCI line types for line and for bar

2009-05-12 Thread Ben Bolker
Anyone has some clue to this question? Thanks in advance! lehe wrote: > > Hi, > I was wondering how to specify the line type for line instead of for bar. > Here is my code: > "plotCI(x=mcra1avg, uiw=stdev1, type="l",col=2,lty=2)" > This way, I will have the bar line as dashed "lty=2" and red

Re: [R] Do you use R for data manipulation?

2009-05-12 Thread Warren Young
Farrel Buchinsky wrote: Is R an appropriate tool for data manipulation and data reshaping and data organizing? I think so but someone who recently joined our group thinks not. The new recruit believes that python or another language is a far better tool for developing data manipulation scripts th

Re: [R] curve fitting

2009-05-12 Thread Katharine Mullen
or use nls.lm as in install.packages("minpack.lm") library(minpack.lm) x <- c(2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74) y <- c(100, 99, 99, 98, 97, 94, 82, 66, 48, 38, 22, 10, 1) res <- function(p, x, y) y - ff(p,x) ff <- function(p, x) 100*exp(p[1]*(1-exp(p[2]*x))/p[2]) aa <- nls.lm(par

Re: [R] (no subject)

2009-05-12 Thread Rolf Turner
On 13/05/2009, at 2:22 PM, Debbie Zhang wrote: Dear R users, Does anyone know how to graph the function below? sqrt(2)Γ(n/2)/[sqrt(n − 1)Γ((n − 1)/2] Yes, pretty well everyone knows how to graph it. Please help. No. Do your own homework. cheers,

Re: [R] (no subject)

2009-05-12 Thread jim holtman
?curve just create an R expression for the equation and then plot it. I am not sure exactly what your expression is supposed to be. On Tue, May 12, 2009 at 10:22 PM, Debbie Zhang wrote: > > > Dear R users, > > Does anyone know how to graph the function below? > > sqrt(2)Ã(n/2)/[sqrt(n - 1)Ã((n

[R] (no subject)

2009-05-12 Thread Debbie Zhang
Dear R users, Does anyone know how to graph the function below? sqrt(2)Γ(n/2)/[sqrt(n − 1)Γ((n − 1)/2] Please help. Debbie _ Want to stay on top of your life online? Find out how with Windows Live! http://windowslive.ni

[R] pair matching query corrected

2009-05-12 Thread Thomas S. Dye
I posed this question imprecisely earlier and did not specify that the pairing needs to be one-to-one. A precise version of the question follows: Given two numeric vectors of possibly unequal length, I'd like to pair each element of the shorter vector with an element of the longer vector

Re: [R] curve fitting

2009-05-12 Thread Jorge Ivan Velez
Dear Dmitry, Take a look at ?nls and its examples. HTH, Jorge On Tue, May 12, 2009 at 5:44 PM, Dmitry Gospodaryov wrote: > I have the data: > for x: 2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, > for y: 100, 99, 99, 98, 97, 94, 82, 66, 48, 38, 22, 10, 1. > y depends on x by equation: y =

Re: [R] Response surface plot

2009-05-12 Thread Cleber Borges
hello, I have an code for similar plot in 2D. HTH Cleber Borges -- # # # t

Re: [R] Graphic aspect ratio

2009-05-12 Thread Paul Murrell
Hi MikSmith wrote: > Hi > > I've been playing with a 3x2 graphics device using the default size as it > appears on screen. This has given me tall thin plots which I can resize by > dragging the window and increasing the window width. However I was wondering > if I can force R to produce square p

[R] strucchange | weighted models

2009-05-12 Thread f.query
Greetings - Am hoping to use the strucchange package to look for structural breaks in some messy regression data. A series of preliminary analyses indicate that BLUE for these data will involve some weighting the data (estimates of a particular population parameter) by a function of the varian

[R] curve fitting

2009-05-12 Thread Dmitry Gospodaryov
I have the data: for x: 2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, for y: 100, 99, 99, 98, 97, 94, 82, 66, 48, 38, 22, 10, 1. y depends on x by equation: y = 100*exp(b*(1-exp(c*x))/c), where b and c are coefficients. I need to find coefficients in this equation for given data. How can I do

Re: [R] pair matching

2009-05-12 Thread David Winsemius
So, given these vectors, what's the right answer? a <-c(1,2,3) b<-c(2, 3, 4 ,5, 6) 2,2,3 (distance =1) or 2,3,4 (distance=3)? I.e., is recycling of elements allowed or must the pairing be one-one? if the first, then: df <- expand.grid(a,b) df$dist <- with(df, (Var1-Var2)^2 ) head(df[o

Re: [R] Looking for a quick way to combine rows in a matrix

2009-05-12 Thread Jorge Ivan Velez
Dear Jacy, If AT and TA always one after the other, you might consider the following as an alternative: res <- apply(a, 2, function(x) c(x[1], sum(x[2:3]), x[4] )) rownames(res) <- rownames(a)[-3] res #[,1] [,2] [,3] [,4] #AA159 13 #AT5 13 21 29 #TT48 12 16 HTH

Re: [R] Looking for a quick way to combine rows in a matrix

2009-05-12 Thread Rocko22
In the first reply, what was calculated was the overall means by group (amino acids). It does not work for a larger database. I am quite really new to R, and I worked on your question just to learn how to manipulate data with R. The following seems to work. The code could be made a lot more elegan

Re: [R] Citing R/Packages Question

2009-05-12 Thread spencerg
Hi, Stephen: Have you discussed this with any of your professors? With a little luck, you might find the right prof to work with who could help you select an ecology journal and write an article for that journal giving an overview of your package. I suggest you think in terms of a 2-

Re: [R] plotCI line types for line and for bar

2009-05-12 Thread lehe
Anyone has some clue to this question? Thanks in advance! lehe wrote: > > Hi, > I was wondering how to specify the line type for line instead of for bar. > Here is my code: > "plotCI(x=mcra1avg, uiw=stdev1, type="l",col=2,lty=2)" > This way, I will have the bar line as dashed "lty=2" and red "c

Re: [R] Help needed to compile R with shared library.

2009-05-12 Thread Tena Sakai
Hi, I got it compiled. > It says "recompile with -fPIC" But I am already > doing so, am I not? It appeared so, but in fact that wasn't what happened. When I looked at the date of CConverters.o, I realized the date was several days old. I deleted the entire tree and did everything once more (fr

Re: [R] how to take away the same varible when I use "merge"

2009-05-12 Thread jim holtman
Can you provide commented, minimal, self-contained, reproducible code. You can check out 'duplicated' to remove duplicates. On Tue, May 12, 2009 at 7:06 AM, Xin Shi wrote: > Dear: > > > > I am trying to merge two tables by a common variable. However, there are a > few same variables which are in

[R] Can anyone suggest some r packages for Experimental Designs, specifically for choice and conjoint??? (or is intersted in helping me make 1)

2009-05-12 Thread Chris Howden
Afternoon everyone, I've spent the last week or so looking at all the experimental design packages I can find in R. AlgDesign, design.conf and BHH2 being the best one I could find. Unfortunately none of these do a particularly good job for complex designs, in particular for conjoint or disc

[R] Specifying data type when creating a dataframe using RODBC

2009-05-12 Thread Mark Na
H R-helpers, I am using the following code to make a dataframe from an Excel spreadsheet: library(RODBC) channel <- odbcConnectExcel("Spreadsheet.xls") Data <- sqlFetch(channel, "Tab1") odbcClose(channel) One column (several, actually) in the spreadsheet contains integers in its first few rows b

Re: [R] Help with kalman-filterd betas using the dlm package

2009-05-12 Thread spencerg
Have you worked through "vignette('dlm')"? Vignettes are nice because they provide an Adobe Acrobat Portable Document Format (pdf) file with a companion R script file, which you can get as follows: (dlm. <- vignette('dlm')) Stangle(dlm.$file) The first of these two lines opens

[R] Bootstrap error rate for logistic disrmination model

2009-05-12 Thread bigi001 bigi001
Hi, i am trying to find an appopriate R function which will estimate the bias associated with the apparent error rate of my logistic discriminant model (groups = 2, covariates = 3). I have read that bootstrapping can be used for this. Does anyone have any ideas on how I can go about doing this? I

Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread stephen sefick
rgl will rotate and zoom, but I don't know if you can select points. On Tue, May 12, 2009 at 4:35 PM, Abby Drake wrote: > It looks like Rcmdr may be able to select points on 3D scatterplots > however when I try to use it's 3dscatter plot function I get the error > message:  could not find functio

Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread Abby Drake
It looks like Rcmdr may be able to select points on 3D scatterplots however when I try to use it's 3dscatter plot function I get the error message: could not find function "nice" If I copy the code: scatter3d(data$X, data$Z, data$Y, surface=FALSE, residuals=TRUE, bg="white", + axis.scales=TRUE,

Re: [R] Sweave: Howto write real TeX formula in plot

2009-05-12 Thread Uwe Ligges
Jonas Stein wrote: Thank you, Baptiste and Charlie. I found some examples wich look great on: http://www.texample.net/tikz/examples/ Perhaps try the pgfSweave package on r-forge? http://r-forge.r-project.org/projects/pgfsweave/> [..] accomplished using the java utility eps2pgf and require

Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread Uwe Ligges
Or with scatterplot3d: The regular identify() usage with the iris data: s3d <- scatterplot3d(iris[,1:3], color=as.numeric(iris[,5])) identify(s3d$xyz.convert(iris[,1:3])) or for locator: the values you get are the 2D representation of the current coordinate system and you can use locator dir

[R] adonis help - (non-parametric (permutational) manova)

2009-05-12 Thread stephen sefick
I am trying to apply this technique (M.J Anderson 2001) to a dataset of aquatic insect abundances. There is a sample in the unrestored and restored segement of a stream for every time period. I would like to compare the centroids of the distance matrices for the treatments up (unrestored) and dn

[R] Automatic task planner

2009-05-12 Thread Bart Joosen
Hi, I'm making a database for my company, and I would like to automate some tasks. One of the tasks that is demanding a lot of time is making up the task schedule. I'm wondering if it's possible to automate this, and how this can be done. As the database is made up in postgresql, I can access my d

[R] Help needed to compile R with shared library.

2009-05-12 Thread Tena Sakai
Hi, I cannot compile R with shared library. I am using Redhad Linux on Dell hardware. Here''s what I am doing: I set ?PICFLAGS in config.site file: CPICFLAGS=-fPIC FPICFLAGS=-fPIC and issue: ./configure --enable-R-shlib --prefix=$HOME/newR make configure finishes with no complaints, the las

[R] How do I extract the scoring equations for neural networks and support vector machines?

2009-05-12 Thread jude.ryan
Sorry for these multiple postings. I solved the problem using na.omit() to drop records with missing values for the time being. I will worry about imputation, etc. later. I calculated the sum of squared errors for 3 models, linear regression, neural networks, and support vector machines. This

Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread Duncan Murdoch
On 5/12/2009 3:08 PM, Abby Drake wrote: Hello Everyone, I am new to R and need some help. I have a matrix of x,y,z coordinates that I would like to interactively plot in 3D and then using the cursor select points on the plot and have the coordinates sent to a matrix. I am using the rgl package

Re: [R] Sweave: Howto write real TeX formula in plot

2009-05-12 Thread Jonas Stein
Thank you, Baptiste and Charlie. I found some examples wich look great on: http://www.texample.net/tikz/examples/ >> Perhaps try the pgfSweave package on r-forge? >> http://r-forge.r-project.org/projects/pgfsweave/> > [..] > accomplished using the java utility eps2pgf and requires the PGF/TiKZ

[R] selecting points on 3D scatterplots

2009-05-12 Thread Abby Drake
Hello Everyone, I am new to R and need some help. I have a matrix of x,y,z coordinates that I would like to interactively plot in 3D and then using the cursor select points on the plot and have the coordinates sent to a matrix. I am using the rgl package to plot the data at the moment because it

Re: [R] Using loops to run functions over a list of variables

2009-05-12 Thread Matt Killingsworth
Jun, sapply() does the trick! Thank you Jun! I really appreciate your help. -Matt On Tue, May 12, 2009 at 1:20 PM, Jun Shen wrote: > Forgot one thing, make sure your data is a list or data frame. > > > On Tue, May 12, 2009 at 12:19 PM, Jun Shen wrote: > >> I don't think get(factor[i]) will

Re: [R] Fwd: From two colors to 01 sequences

2009-05-12 Thread Paul Smith
On Tue, May 12, 2009 at 2:35 PM, Zeljko Vrba wrote: > Aha, so you DON'T have only red and green rectangles in the picture, there is > also white in between, and some pale delimiter lines.  Nevertheless, both > things ease the job slightly, and the approach I described should work.  You > can even

Re: [R] pair matching

2009-05-12 Thread Liaw, Andy
If the matching need not be one-to-one, then you can just compute the Euclidean distances between the two vectors, then in each row (or column, which ever corresponds to the shorter vector) and find the smallest. This should be fairly easy to do. Andy From: Thomas S. Dye > > Given two numeric

Re: [R] Two-way Anova

2009-05-12 Thread Mike Lawrence
Using traditional ANOVA, you'd have to drop either cases or time points with missing data. Using linear mixed effects analysis, you'd be able to use all the data. LME also has the benefit of *not* assuming sphericity, which is good for data like yours (many measures across few cases) where the trad

Re: [R] Looking for a quick way to combine rows in a matrix

2009-05-12 Thread Johannes Hüsing
jim holtman schrieb: Try this: key <- rownames(a) key[key == "AT"] <- "TA" do.call(rbind, by(a, key, colSums)) something like paste(sort(strsplit(key, split="")[[1]]), "") might be more general. __ R-help@r-project.org mailing list https:/

[R] FW: neural network not using all observations

2009-05-12 Thread jude.ryan
As a follow-up to my email below: The input data frame to nnet() has dimensions: > dim(coreaff.trn.nn) [1] 50888 And the predictions from the neural network (35 records are dropped - see email below for more details) has dimensions: > pred <- predict(coreaff.nn1) > dim(pred)

Re: [R] Using loops to run functions over a list of variables

2009-05-12 Thread Jun Shen
Forgot one thing, make sure your data is a list or data frame. On Tue, May 12, 2009 at 12:19 PM, Jun Shen wrote: > I don't think get(factor[i]) will work. The problem is get only sees a > character string "data$focus" instead of doing "extracting focus from data". > In your case isn't lapply (or

Re: [R] Using loops to run functions over a list of variables

2009-05-12 Thread Jun Shen
I don't think get(factor[i]) will work. The problem is get only sees a character string "data$focus" instead of doing "extracting focus from data". In your case isn't lapply (or sapply) good enough? sapply (data, summary) try ?lapply for details Jun On Tue, May 12, 2009 at 10:55 AM, rapton wrot

[R] Multiple plot margins

2009-05-12 Thread Andre Nathan
Hello I'm plotting 6 graphs using "mfrow = c(2, 3)". In these plots, only graphs in the first column have titles for the y axis, and only the ones in the last row have titles for the x axis. I'd like all plots to be of the same size, and I'm trying to keep them as near each other as possible, but

[R] pair matching

2009-05-12 Thread Thomas S. Dye
Given two numeric vectors of possibly unequal length, I'd like to pair each element of the shorter vector with an element of the longer vector such that the sum of squared differences between the pairs is minimized. Can someone point me to an R function or an algorithm for accomplishing th

Re: [R] rbind help

2009-05-12 Thread James W. MacDonald
Hi Mike, MikSmith wrote: Hi I have a dataset of orientation and elevation in a dataframe which I am plotting in circular. Orientation is on the range 0-360, however I need to reduce this to 0-180 as the values over 180 are not necessarily correct. I can do striae$orientation[striae$orientation

[R] Using loops to run functions over a list of variables

2009-05-12 Thread rapton
Hello, I have a data set with many variables, and often I want to run a given function, like summary() or cor() or lmer() etc. on many combinations of one or more than one of these variables. For every combination of variables I want to analyze I have been writing out the code by hand, but given

[R] triangle.class pch per factor

2009-05-12 Thread HighSchool2005
Hello, I am using triangle.class in ade4 package and a factor. I would like to use this graphic parameter (pch) to set a different kind of point for each group in my factor (lakes). I have tried pch=1:4, I guess it does what it is supposed to do but not what I want. I can't use colors. Thank you

Re: [R] How to display data content on a only row?

2009-05-12 Thread Thom_249
Hello Dieter I got them from a Matrix on with I use the applyfunction tu compute the mean columns by columns print(apply(matSD,2,mean)) So it's a kind of vector. I'll check with the cat function Thank you, have a nice day Thomas -- View this message in context: http://www.nabble.com/How-to

[R] how to take away the same varible when I use "merge"

2009-05-12 Thread Xin Shi
Dear: I am trying to merge two tables by a common variable. However, there are a few same variables which are in both of two tables. How can I take them away when I merge the two tables? Thanks! Xin __ R-help@r-project.org mailing li

[R] questions on rpart (tree changes when rearrange the order of covariates?!)

2009-05-12 Thread Yuanyuan
Greetings, I am using rpart for classification with "class" method. The test data is the Indian diabetes data from package mlbench. I fitted a classification tree firstly using the original data, and then exchanged the order of Body mass and Plasma glucose which are the strongest/important varia

[R] Graphic aspect ratio

2009-05-12 Thread MikSmith
Hi I've been playing with a 3x2 graphics device using the default size as it appears on screen. This has given me tall thin plots which I can resize by dragging the window and increasing the window width. However I was wondering if I can force R to produce square plots or set the actual aspect ra

Re: [R] Partial Derivatives in R

2009-05-12 Thread Paul Heinrich Dietrich
Thanks for showing me how to use genD correctly and that it matches deriv here. Like you say, there must be a problem with the manual way of doing it, and I will look at it closely. Thanks again. spencerg wrote: > > Hi, Paul: > > > Your example is so complicated that I don't want to

Re: [R] How to display data content on a only row?

2009-05-12 Thread Thom_249
Totally awsom! Thank you very much Thom -- View this message in context: http://www.nabble.com/How-to-display-data-content-on-a-only-row--tp23497437p23502952.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

[R] rbind help

2009-05-12 Thread MikSmith
Hi I have a dataset of orientation and elevation in a dataframe which I am plotting in circular. Orientation is on the range 0-360, however I need to reduce this to 0-180 as the values over 180 are not necessarily correct. I can do striae$orientation[striae$orientation>180]-180) to extract thes

[R] Two-way Anova

2009-05-12 Thread Alan O'Loughlin
Hello, I'm trying to do a comparsion on a large scale say 10L bottle of liquid and a small scale bottle of liquid 0.5L, I have 5 different samples from each and they are measured over the space of 8 days as % viability and the % viability decreases over time. However not all 10 samples got me

[R] Fw: Hold out procedures in R software

2009-05-12 Thread Oludare Ariyo
> > > I am a PhD Student at the University of > >Agriculture,Abeokuta Nigeria.Also a Statistician at > National > > Horticultural Research institites ibadan Nigeria. > > > > I currently working on Discriniant analysis and i need > a > > help on hoe to solve Lanche Bruch's "hold out > Procedure"

[R] variability

2009-05-12 Thread elisia
I am analyzing the voice telephone traffic of some operators. In this type of phenomenon is useful to consider the anomalies in the duration in minutes of conversation but it is very important to take account of another variable: average time of conversation, the relationship between the duration

Re: [R] newtons method

2009-05-12 Thread Ravi Varadhan
Uwe, John's comment about the difficulties with finding polynomial roots is even more forceful for a system of polynomials. There are likely numerous roots, some possibly real, and some possibly multiple. Homotopy methods are currrently the state-of-art for finding "all" the roots, but beware th

[R] AFT-model with time-dependent covariates

2009-05-12 Thread Philipp Rappold
Dear R-community, Dear Prof. Therneau, I would like to fit an AFT-model with time-dependent covariates and right-censored data. Searching the mailing list for information on the subject, I found some old posts which said it didn't work back then. My questions: (1) Has this kind of fitting al

[R] Trouble with parametric bootstrap

2009-05-12 Thread Anders Bjorn
Hi, I'm having trouble understanding how to construct a random number generator for a parametric bootstrap. My aim is to bootstrap a Likelihood Ratio statistic (under the null) for a linear model. The function at this point is given by boot.test.n01 <- function(data, indeces, maxit=20) { y1 <- f

[R] R Group on Professional Networking Site

2009-05-12 Thread agdesilva
Greetings: There is a LinkedIn R Group. There are job postings, news, as well as other discussions. http://www.linkedin.com/groups?about=&gid=77616&trk=anet_ug_grppro Regards, Ajit http://www.linkedin.com/groups?about=&gid=77616&trk=anet_ug_grppro __

Re: [R] Response surface plot

2009-05-12 Thread Duncan Murdoch
On 5/12/2009 8:43 AM, Tim Carnus wrote: Dear List, I am trying to plot a similar graph to attached from minitab manual in R. I have a response Y and three components which systematically vary in their proportions. I have found in R methods/packages to plot ternary plots (eg. plotri

[R] R Group on Professional Networking Site

2009-05-12 Thread Ajit de Silva
Greetings: There is a LinkedIn R Group. There are job postings, news, as well as other discussions. http://www.linkedin.com/groups?about=&gid=77616&trk=anet_ug_grppro Regards, Ajit -- _ Ajit Gemunu de Silva Oakland CA 94619 skype: ajit_de_silva [[alt

[R] neural network not using all observations

2009-05-12 Thread jude.ryan
I am exploring neural networks (adding non-linearities) to see if I can get more predictive power than a linear regression model I built. I am using the function nnet and following the example of Venables and Ripley, in Modern Applied Statistics with S, on pages 246 to 249. I have standardized vari

[R] import HTML tables

2009-05-12 Thread Dimitri Szerman
Hello, I was wondering if there is a function in R that imports tables directly from a HTML document. I know there are functions (say, getURL() from {RCurl} ) that download the entire page source, but here I refer to something like google document's function importHTML() (if you don't know this fun

[R] R^2 extraction and autocorrelation/heterokedasticity on TSLS regression

2009-05-12 Thread Axel Leroix
Hi,   I'm actually I’m performing a TSLS linear multiple regression on annually data which go from 1971 to 1997. After performing the TSLS regression, I tried to extract the R squared value using “output$r.squared” function and to perform autocorrelation (Durbin Watson and Breus

Re: [R] newtons method

2009-05-12 Thread Uwe Ligges
John C Nash wrote: Finding polynomial roots is not a problem where one wants a quick and dirty code. There are a lot of pitfalls, especially if there are roots that are multiples, and there has been a lot of work on this problem. See http://en.wikipedia.org/wiki/Category:Root-finding_algorith

Re: [R] Power function for ratio of lognormal means: two equally

2009-05-12 Thread Ted Harding
On 12-May-09 12:00:50, Steve Candy wrote: > Hi All > This is a general stats problem that I am dealing with using R, > so any help is greater appreciated. > > I have two lognormal distributions with means M1 and M2. > If we have: > > H0: log(M1/M2)=0 > > H1: log(M1/M2) !=0 equivalent to log(M1/M

[R] RES: SAS PROC SORT nodupkey

2009-05-12 Thread Leandro Marino
Amor, You have the possibility to use the duplicated() function. A[!duplicated(A[,var]),] Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@ces

Re: [R] Warning trying to plot -log(log(survival)) (John Sorkin)

2009-05-12 Thread Terry Therneau
John, Nothing about the data set you posted should give issues in any version of the package. The "points <=0" usually arises when the survival curve drops to zero, and so log(-log(0)) is being trimmed off the graph by the plot command. This is what should happen. As Thomas pointed out t

Re: [R] newtons method

2009-05-12 Thread John C Nash
Finding polynomial roots is not a problem where one wants a quick and dirty code. There are a lot of pitfalls, especially if there are roots that are multiples, and there has been a lot of work on this problem. See http://en.wikipedia.org/wiki/Category:Root-finding_algorithms . And Uwe may not

Re: [R] SAS PROC SORT nodupkey

2009-05-12 Thread Chuck Cleland
On 5/12/2009 8:29 AM, amor Gandhi wrote: > Hi, > > I have the following data and I would like to delete douple names, it is > almost similar to SAS PROC SORT nodupkey! Is there any function in R does > this? > > x1 <- rnorm(11,5,1) > x2 <- runif(11,0,1) > nam <-paste("A", c(1:4,4,5:9,9), sep=

[R] plotCI line types for line and for bar

2009-05-12 Thread lehe
Hi, I was wondering how to specify the line type for line instead of for bar. Here is my code: "plotCI(x=mcra1avg, uiw=stdev1, type="l",col=2,lty=2)" This way, I will have the bar line as dashed "lty=2" and red "col=2", and the line connecting the centers of the bars is also red "col=2" but solid

Re: [R] survival curves for time dependent covariates (was "consultation")

2009-05-12 Thread Terry Therneau
*I´m writing to ask you how can I do Survivals Curves using Time-dependent *covariates? Which packages I need to Install?* This is a very difficult problem statistically. That is, there are not many good ideas for what SHOULD be done. Hence, there are no packages. Almost everything you find

[R] Response surface plot

2009-05-12 Thread Tim Carnus
Dear List, I am trying to plot a similar graph to attached from minitab manual in R. I have a response Y and three components which systematically vary in their proportions. I have found in R methods/packages to plot ternary plots (eg. plotrix) but nothing which can extend it to res

Re: [R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Thanks, Baptiste and Zeljko. I am attaching here an example of the picture of the rectangles. Paul On Tue, May 12, 2009 at 1:23 PM, baptiste auguie wrote: > > Depending on the nature of your pdf file, it may be possible to use > the grImport package. I've never used it before, but a quick test

[R] Response surface plot

2009-05-12 Thread Tim Carnus
Dear List, I am trying to plot a similar graph to attached from minitab manual in R. I have a response Y and three components which systematically vary in their proportions. I have found in R methods/packages to plot ternary plots (eg. plotrix) but nothing which can extend it to response surface

Re: [R] How to display data content on a only row?

2009-05-12 Thread Dieter Menne
Thom_249 wrote: > > I got them from a Matrix on with I use the applyfunction tu compute the > mean columns by columns > print(apply(matSD,2,mean)) > matSD = matrix(round(rnorm(20),2),nrow=4) cat(matSD) print(matSD) dput(matSD) # How to send this matrix to r-help newMat = apply(matSD,2,mean)

[R] SAS PROC SORT nodupkey

2009-05-12 Thread amor Gandhi
Hi,   I have the following data and I would like to delete douple names, it is almost similar to SAS PROC SORT nodupkey! Is there any function in R does this?   x1 <- rnorm(11,5,1) x2 <- runif(11,0,1) nam <-paste("A", c(1:4,4,5:9,9), sep=".") mydata <- data.frame(x1,x2) crownames(mydata) <- nam  

Re: [R] From two colors to 01 sequences

2009-05-12 Thread baptiste auguie
Depending on the nature of your pdf file, it may be possible to use the grImport package. I've never used it before, but a quick test seems promising, > # create a test picture > colorStrip <- > function (colors, draw = T) > { > x <- seq(0, 1 - 1/ncol(colors), length = ncol(colors)) >

Re: [R] ROCR: auc and logarithm plot

2009-05-12 Thread Tobias Sing
To color the error bars in ROCR the same way as the performance curve, you need to add one more argument (plotCI.col='red') to your plot call: plot( perf2,avg="threshold",lty=2,col=2, spread.estimate="stddev", plotCI.col=2) The use of 'plotCI.col' is an example for the general mechanism of ROCR t

Re: [R] extracting residuals from glm object

2009-05-12 Thread Marc Schwartz
On May 12, 2009, at 3:50 AM, utkarshsinghal wrote: Hi All, Can anybody explain why the following three ways of extracting residuals from a glm object are giving me different outputs: > idv = runif(1000,0,1) > dv = rbinom(1000,1,0.5) > d = data.frame(idv,dv) > fit = glm(dv~idv, data=d, famil

[R] Power function for ratio of lognormal means: two equally valid results? [SEC=Unclassified]

2009-05-12 Thread Steve Candy
Hi All This is a general stats problem that I am dealing with using R, so any help is greater appreciated. I have two lognormal distributions with means M1 and M2. If we have: H0: log(M1/M2)=0 H1: log(M1/M2) !=0 equivalent to log(M1/M2)=log(1+P) where P<0 or P>0. If we calculate the power fo

Re: [R] ROCR: auc and logarithm plot

2009-05-12 Thread Tim
Thanks Tobias! A new question: if I want to draw an average ROC from cross-validation, how to make the bar color same as the line color? Here is my code: "plot( perf2,avg="threshold",lty=2,col=2, spread.estimate="stddev",barcol=2)" Even I specify "barcol=2", the color of bars are still black, th

Re: [R] From two colors to 01 sequences

2009-05-12 Thread Zeljko Vrba
On Tue, May 12, 2009 at 12:20:56PM +0100, Paul Smith wrote: > > I have got several pdf files with rows of colored rectangles: red > rectangles should be read as 0; green rectangles as 1. No other color > exists. Is there some way to have R reading the colored rectangles to > a matrix or data frame

Re: [R] xyplot: no ticks for a factor scale?

2009-05-12 Thread Richard . Cotton
> I would like to have no ticks on a scale that represents a factor. The > tick.number argument from scales does not work in such a situation, as > the help page as well as this simple (fairly stupid) code show: > > require(lattice) > fact<-gl(4,1,labels=LETTERS[1:4]) > y<-c(1,4,3,2) > xyplot(y~fa

Re: [R] Partial Derivatives in R

2009-05-12 Thread Gabor Grothendieck
You could also use rSymPy to symbolically differentiate it. For example, based on the semi-automatic differentiation example on the rSymPy home page: http://code.google.com/p/rsympy/#Semi-Automatic_Differentiation just replace the indented lines there with the indented lines here (I've also added

[R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Dear All, Perhaps, what I am asking is impossible, but I am asking it anyway. I have got several pdf files with rows of colored rectangles: red rectangles should be read as 0; green rectangles as 1. No other color exists. Is there some way to have R reading the colored rectangles to a matrix or d

Re: [R] Kumaraswamy distribution

2009-05-12 Thread Mike Lawrence
dkumar = function(x,a,b) a*b*(x^(a-1))*((1-x^a)^(b-1)) pkumar = function(x,a,b) 1-(1-x^a)^b (I've based this entirely on the wikipedia entry on the Kumaraswamy distribution [http://en.wikipedia.org/wiki/Kumaraswamy_distribution], so best to check both my replication of the formula there and the ac

Re: [R] Kumaraswamy distribution

2009-05-12 Thread G. Jay Kerns
Dear Debbie, On Tue, May 12, 2009 at 5:37 AM, Debbie Zhang wrote: > > Dear R users, > > Does anyone know how to write function for Kumaraswamy distribution in R? > Since I cannot write dkumar, pkumar, etc. in R. > > > > Please help. > > > > Thanks a lot, > > Debbie > Check the CRAN Task View on

[R] xyplot: no ticks for a factor scale?

2009-05-12 Thread Marcin Kozak
Hi, I would like to have no ticks on a scale that represents a factor. The tick.number argument from scales does not work in such a situation, as the help page as well as this simple (fairly stupid) code show: require(lattice) fact<-gl(4,1,labels=LETTERS[1:4]) y<-c(1,4,3,2) xyplot(y~fact,scales=l

Re: [R] What's the best way to tell a function about relevant fields in data frames

2009-05-12 Thread Duncan Murdoch
On 12/05/2009 6:18 AM, Titus von der Malsburg wrote: Hi list, I have a function that detects saccadic eye movements in a time series of eye positions sampled at a rate of 250Hz. This function needs three vectors: x-coordinate, y-coordinate, trial-id. This information is usually contained in a

  1   2   >