Re: [R] is this an ANOVA ?

2011-04-12 Thread Lao Meng
You may try the following to perform anova: anova(lm(y~x)) or summary(aov(y~x)) 2011/4/13 Ubuntu Diego > Hi all, >I have a very easy questions (I hope). I had measure a property of > plants, growing in three different substrates (A, B and C). The rest of the > conditions remained con

[R] evaluate a series of equations for a vector

2011-04-12 Thread Benjamin Caldwell
Hi folks, I have a script that will evaluate a single equation for a vector and write graphs to a folder: - species.name="CussoniaHolstii" dia<-10:100 biomass.equals<-21.4863 + 0.5797 * (dia ^ 2)

Re: [R] multiple lines on multiple plots

2011-04-12 Thread baptiste auguie
Hi, ggplot2 automatically adjusts its axes when new data are added to plots; however you wouldn't get an automatic legend if you constructed plots that way. HTH, baptiste On 13 April 2011 17:06, James Annan wrote: > Thanks for all the replies. Yes, I agree that calculating all the data first >

Re: [R] font and size times New Roman

2011-04-12 Thread Peter Alspach
Tena koe Fabiane ?par In particular, various cex. parameters. These can be used with plot (e.g., plot(x, y, cex.axis=1.2)) HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Fabiane Silva > Sent: Wedn

Re: [R] font and size times New Roman

2011-04-12 Thread Prof Brian Ripley
You wrote yesterday and got a reply asking for more information (as did the posting guide), which you still have not provided, and giving you several hints of where in the help to look. We cannot help you if you refuse to help us help you. See https://stat.ethz.ch/pipermail/r-help/2011-April/2

Re: [R] What does the command diag(solve(matrix)) do?

2011-04-12 Thread Peter Alspach
Tena koe Tiago ?solve ?diag will tell you what those R functions do. Why the code wants the diagonal of the inverse of that particular correlation matrix is another matter. If the matrix is the so-called numerator relationship matrix (i.e., twice the coancestry matrix) then its inverse is us

Re: [R] multiple lines on multiple plots

2011-04-12 Thread James Annan
Thanks for all the replies. Yes, I agree that calculating all the data first is a simple solution which also has the benefit of making the axis choice easier to get right, but on the downside it requires storing an order of magnitude more output than my original sequential approach would have d

Re: [R] How to calculate KMO?

2011-04-12 Thread Thibault Grava
Thank you so much, it helped a lot!! Cheers! Thibault On Tue, Apr 12, 2011 at 3:31 PM, G. Jay Kerns [via R] < ml-node+3445833-834565539-229...@n4.nabble.com> wrote: > Dear Thibault, > > On Tue, Apr 12, 2011 at 5:06 PM, Thibault Grava > <[hidden > email]

[R] automate package installation

2011-04-12 Thread jkang
I have an ubuntu image with R installed. I want to install a list of packages that does not come with R. eg. cluster, gplots, hacks, mapdata. etc. Over time this list may grow. Is there a config file that can tell R what and where to install additional packages? My goal is to store all R packa

[R] The three routines in R that calculate the wilcoxon signed-rank test give different p-values.......which is correct?

2011-04-12 Thread Michael G Rupert
I have a question concerning the Wilcoxon signed-rank test, and specifically, which R subroutine I should use for my particular dataset. There are three different commands in R (that I'm aware of) that calculate the Wilcoxon signed-rank test; wilcox.test, wilcox.exact, and wilcoxsign_test. When

[R] What does the command diag(solve(matrix)) do?

2011-04-12 Thread tiago.pere...@mbe.bio.br
Hello, R users! As a geneticist, and new user of R are still find some basic questions hard to solve. For example, I am trying to understand a code, which uses, for instance, a matrix of correlations: >mymatrix [,1] [,2] [,3] [,4] [,5] [1,] 1.000 0.250 0.2357023 0.2182

[R] font and size times New Roman

2011-04-12 Thread Fabiane Silva
Hello I wonder how to change the font of chart to Times New Roman and size 9. plot(c(0,100,20),c(0,600,50), xlab= 'Idade(meses)', ylab="Peso(kg)", type = "n", axes=F) axis(1, pos=0, at=seq(0,100,20)) axis(2, pos=0, at=seq(0,600,100)) t<- seq(0,100,1) TA=543.56*(1-0.8976*exp(-0.0522*t)) NI=498.9

[R] Clustering help in Heat Maps

2011-04-12 Thread khush ........
Dear Experts, I am using the below script to generate the heat map of gene expression data. I am using Hierarchical Clustering (hclust) for clustering. Now I want to compare different clustering parameters such as *K-means* clustering, Model Based Clustering, I have two queries: 1. How to incorp

Re: [R] print to .jpeg

2011-04-12 Thread Benjamin Caldwell
Luke, Just caught that myself. Thanks for the help, did the trick! *Ben Caldwell* On Tue, Apr 12, 2011 at 7:03 PM, Luke Miller wrote: > And of course I need to close the parentheses completely on jpeg(). > Apologies for the double post. > > jpeg(paste(species.name, '.jpg', sep = '')) > > > On

[R] Is there a better way to parse strings than this?

2011-04-12 Thread Chris Howden
Hi Everyone, I needed to parse some strings recently. The code I've wound up using seems rather clunky, and I was wondering if anyone had any suggestions on a better way? Basically I do the following: 1) Use substr() to do the parsing 2) Use regexpr() to find the location of the string I want

Re: [R] print to .jpeg

2011-04-12 Thread Henrik Bengtsson
Hi, First, don't use JPEG for your scientific plots - the image file format uses a compression that is really bad for anything but photos. Instead use PNGs. For scientific plots, PNG files are often also smaller than JPEG files, e.g. in your case the JPEG is ~4 times larger than the PNG. See also

Re: [R] is this an ANOVA ?

2011-04-12 Thread Steven McKinney
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Ubuntu Diego > Sent: April-12-11 5:10 PM > To: r-help@r-project.org > Subject: [R] is this an ANOVA ? > > Hi all, > I have a very easy questions (I hope). I had measure a

Re: [R] print to .jpeg

2011-04-12 Thread Luke Miller
And of course I need to close the parentheses completely on jpeg(). Apologies for the double post. jpeg(paste(species.name, '.jpg', sep = '')) On Tue, Apr 12, 2011 at 10:02 PM, Luke Miller wrote: > How about using paste() inside the jpeg() function to append a '.jpg' to > the end of your specie

Re: [R] print to .jpeg

2011-04-12 Thread Luke Miller
How about using paste() inside the jpeg() function to append a '.jpg' to the end of your species name? See the change below. I also added a dev.off() to close the newly created jpeg. species.name="CussoniaHolstii" dia<-10:100 biomass = -21.4863 + 0.5797 * (dia ^ 2) biomass jpeg(paste(species.name,

[R] print to .jpeg

2011-04-12 Thread Benjamin Caldwell
Evening folks, I'm trying to print a series of graphs to .jpeg using a variable as the title, but run into the difficultly that I can't find a way to append the file extension to the .jpeg (in this case extensionless!) files. Example: species.name="CussoniaHolstii" dia<-10:100 biomass = -21.

Re: [R] Assign with Paste Problem

2011-04-12 Thread baptiste auguie
Hi, You probably need ?get, though you might want to read this first, library(fortunes) fortune(236) HtH, baptiste On 13 April 2011 13:04, Sparks, John James wrote: > Dear R Helpers, > > I am trying to change the name of an object using the assign function. > When I use paste on the new obje

Re: [R] Model formula for ols function (rms package)

2011-04-12 Thread Frank Harrell
Hi Mark, You are quite correct. My apologies. That should have been rcs(x1, 3) + rcs(x2, 3) + x1 %ia% x2 or pol(x1, 2) + pol(x2, 2) + x1 %ia% x2 Frank Mark Seeto wrote: > > Thank you for your reply, Frank. %ia% drops the product x1'*x2', but > keeps x1*x2' and x1'*x2. Is there a way to drop

[R] Assign with Paste Problem

2011-04-12 Thread Sparks, John James
Dear R Helpers, I am trying to change the name of an object using the assign function. When I use paste on the new object but not the old, everything is fine: The new object is a direct copy of the old object. When I use a paste for both the new and the old object, however, the new object is sim

Re: [R] 2-parameter MLE problems

2011-04-12 Thread Ben Bolker
Tyler Schartel msstate.edu> writes: > > Hi all, > > Sorry for the re-post, I sent my previous e-mail before it was complete. I > am trying to model seroprevalence using the differential equation: > dP/dt = beta*seronegative*.001*(seropositive)-0.35*(0.999)*(seropositive)- > r*seropositive.

Re: [R] is this an ANOVA ?

2011-04-12 Thread skfgla...@gmail.com
The response variable "y" does not make sense to me. What does it represent? friedman.st...@gmail.com 517-648-6290 -Original message- From: Ubuntu Diego To: r-help@r-project.org Sent: Wed, Apr 13, 2011 00:12:07 GMT+00:00 Subject: [R] is this an ANOVA ? Hi all, I have a very ea

[R] is this an ANOVA ?

2011-04-12 Thread Ubuntu Diego
Hi all, I have a very easy questions (I hope). I had measure a property of plants, growing in three different substrates (A, B and C). The rest of the conditions remained constant. There was very high variation on the results. I want to do address, whether there is any difference

Re: [R] Model formula for ols function (rms package)

2011-04-12 Thread Mark Seeto
Thank you for your reply, Frank. %ia% drops the product x1'*x2', but keeps x1*x2' and x1'*x2. Is there a way to drop all three of these and include only x1*x2? Or is this not a sensible thing to want to do? Thanks, Mark Frank E Harrell Jr wrote: For the first example you want the restricted int

Re: [R] Removing objects and clearing memory

2011-04-12 Thread B77S
#replace v with whatever rm(list=(ls()[ls()!="v"])) -- View this message in context: http://r.789695.n4.nabble.com/Removing-objects-and-clearing-memory-tp3445763p3445865.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Peter Ehlers
On 2011-04-12 15:52, seeliger.c...@epamail.epa.gov wrote: How do I remove all objects except one in R? rm(list=ls()) #will remove ALL objects But he wanted to remove all objects ***except one***!!! So what's the point of this answer? I can't see any way except a rather round-about kludge to

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Seeliger . Curt
> >> How do I remove all objects except one in R? > >> > > rm(list=ls()) #will remove ALL objects > > But he wanted to remove all objects ***except one***!!! So what's the > point of this answer? > > I can't see any way except a rather round-about kludge to do what the > OP wants. ... That migh

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Denis Kazakiewicz
This should work also data.frame(ls()) rm(list=ls()[-5]) #for instance On 13.04.2011 01:45, Rolf Turner wrote: > On 13/04/11 09:49, Denis Kazakiewicz wrote: >> On 13.04.2011 00:39, Jim Silverton wrote: >>> How do I remove all objects except one in R? >>> >> rm(list=ls()) #will remove ALL objects

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Rolf Turner
On 13/04/11 09:49, Denis Kazakiewicz wrote: On 13.04.2011 00:39, Jim Silverton wrote: How do I remove all objects except one in R? rm(list=ls()) #will remove ALL objects But he wanted to remove all objects ***except one***!!! So what's the point of this answer? I can't see any way except a

Re: [R] Model formula for ols function (rms package)

2011-04-12 Thread Frank Harrell
For the first example you want the restricted interaction operator: y ~ rcs(x1, 3) + rcs(x2, 3) + rcs(x1, 3) %ia% rcs(x2, 3). For the second example use pol(x,2) or something like pol(x1,2) + pol(x2,2) + pol(x1, 2) %ia% pol(x2, 2) If you have to create new variables for R formulas you're usually

Re: [R] How to calculate KMO?

2011-04-12 Thread G. Jay Kerns
Dear Thibault, On Tue, Apr 12, 2011 at 5:06 PM, Thibault Grava wrote: > Hello Jay, > > I know that an old post but I really need to calculate KMO for my data and > this is the only thread I found on the subject. > > I'm a very newby to R so sorry for the odd questions. > > It looks like in your r

[R] Model formula for ols function (rms package)

2011-04-12 Thread Mark Seeto
Dear R help, I'm having some trouble with model formulas for the ols function in the rms package. I want to have two variables represented as restricted cubic splines, and also include an interaction as a product of linear terms, but I get an error message. library(rms) d <- data.frame(x1 = rnorm

[R] 2-parameter MLE problems

2011-04-12 Thread Tyler Schartel
Hi all, Sorry for the re-post, I sent my previous e-mail before it was complete. I am trying to model seroprevalence using the differential equation: dP/dt = beta*seronegative*.001*(seropositive)-0.35*(0.999)*(seropositive)-r*seropositive. I would like to estimate my two parameters, beta and r, us

Re: [R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Shawn Koppenhoefer
Solution found... Sorry for not having known this,... Apparently, what I was after is called a "Choleski factorization". The solution pops right out of R, as follows: > M<-matrix(c(0.6098601, 0.2557882, 0.1857773, + 0.2557882, 0.5127065, -0.1384238, + 0.1857773, -

Re: [R] How to calculate KMO?

2011-04-12 Thread Thibault Grava
Hello Jay, I know that an old post but I really need to calculate KMO for my data and this is the only thread I found on the subject. I'm a very newby to R so sorry for the odd questions. It looks like in your reply that you use "kmo" as a function and you apply it to your data "D"... I tried th

Re: [R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Shawn Koppenhoefer
Thanks to both Doran and Spencer for your helpful answers. @Doran: I still have to parse your answer, as I'm not experienced enough to see immediately how it relates to my M. Sorry for being daft! I don't immediately see how doing a linear regression on two vectors. I'm reading about design ma

[R] split string into individual valus while reading in R

2011-04-12 Thread Ram H. Sharma
Dear R experts Sorry for posting: I have text file that I need to read into R (this is out from different program). A portion of data look like: ;example data 1_1 ch1 0.0 HAAAHHAAAHHAHHAHHAHAHHHAAHHAHHAAAHHAHHAAHAHHHAAAHHHAAAHHAHHHAAAAHHAAHHAHAAAHAHHAAHAAHAA

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Denis Kazakiewicz
On 13.04.2011 00:39, Jim Silverton wrote: How do I remove all objects except one in R? rm(list=ls()) #will remove ALL objects __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

[R] Removing objects and clearing memory

2011-04-12 Thread Jim Silverton
How do I remove all objects except one in R? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posti

Re: [R] a question on the use of 'solve'

2011-04-12 Thread Joshua Wiley
Hi Laura, Did you ?try (a truly terrible pun). Here is a little example: for (i in 1:10) try(print(solve(i != 5), TRUE)) notice that for i == 5, it fails, and prints the error, but the rest output as normal. If you need fancier stuff, look at ?tryCatch Hope this helps, Josh On Tue, Apr 12,

Re: [R] a question on the use of 'solve'

2011-04-12 Thread Carl Witthoft
Check out ?try and ?trycatch . THose are specifically designed to allow you to take note of an error condition while still running your function/script. --- From: Laura Antolini Date: Tue, 12 Apr 2011 19:23:44 +0200 Dear R users, I am in trouble using the function solve(matr

[R] calculate true autocovariance from power spectrum

2011-04-12 Thread Bao, Wenkai
I know using ARMAacf function can do the job for ARMA model, but it is not calculating from power spectrum. I have been trying to code with the following algorithm: Since |1-theta1*exp(2*pi*f*i)-...-thetaq*[exp(2*pi*f*i)]^q|^2 P(f)=sigma2*--

[R] Compatibility with Work Load/Resource Managers

2011-04-12 Thread Mike Michie
Hi, I was wondering if anyone knew whether R is capable of integrating with the following work load/resource managers TORQUE, OpenPBS, PBS Pro, LSF, and SGE? Thanks, Mike [[alternative HTML version deleted]] __ R-help@r-project.org mai

[R] a question on the use of 'solve'

2011-04-12 Thread Laura Antolini
Dear R users, I am in trouble using the function solve(matrix) in a loop. When it happens that I have a singular matrix, I get an error message saying so and the loop stops. My question is if there in any way to keep on going in the loop. Thank you in advance, Laura

Re: [R] Override col.lines and col.symbol in panel.xyplot with type='b'

2011-04-12 Thread Szumiloski, John
Thanks Deepayan. I've been burnt before trying base graphics idioms in lattice graphics, so never even thought to try that. Although I am not sure I would have figured out the row vs. group distinction without diving deeply into the source. Apologies for my obtuseness; I have however learned q

Re: [R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)

2011-04-12 Thread PabloEmilio . Verde
Zitat von Alal : Thanks Im not sure about the gamma, but a survival analysis seems appropriate, but does it work for factors and continuous covariates? Do you have to verify some conditions beforehand? Here is an example: # test data... library(survival) set.seed(1007) x <- runif(50) mu <-

[R] Stepwise Regression with no Origin

2011-04-12 Thread Zd Gibbs
Sorry, the first version was incomplete. I'm trying again. I am running a regression equation and i want to enter in 12 IV then stepwise enter 8 variables and not have an origin.   DV is "shfl". I  want to enter in the following 12 independent dummy variables ajan bfeb cmar dapr emay fjun An

Re: [R] Bayesian PCA

2011-04-12 Thread William Revelle
Dear Lucy, You might consider some of the scale construction techniques available in the psych package. In particular, the iclust function is meant for this very problem: how to form reliable item composites. Bill At 4:38 PM +0100 4/12/11, Christian Hennig wrote: Dear Lucy, not an R-rel

[R] Stepwise Regression with no Origin

2011-04-12 Thread Zd Gibbs
I am running a regression equation and i want to enter in 12 IV then stepwise enter 8 variables and not have an origin.   DV is "shfl". I  want to enter in the following 12 independent dummy variables ajan bfeb cmar dapr emay fjun And then I want to enter in a stepwise fashion slag6 slag6 sla

[R] help for fgui

2011-04-12 Thread David L Lorenz
Anybody use fgui? I find it very handy. I have a question about an argument to the call to gui in the first example. The argument is argFilter, my question has to do with specifying multiple filters. The argument in that example is argFilter=list(flname="{{Text files} {.txt}}") ) #

Re: [R] Predictkion interval using regression coefficients

2011-04-12 Thread Zd Gibbs
I will do that. but I may be back. Thanks. From: Joshua Wiley Cc: r-help@r-project.org Sent: Tue, April 12, 2011 1:59:20 PM Subject: Re: [R] Predictkion interval using regression coefficients Hi Zeda, The short answer to your question is no.  All you have ar

Re: [R] Predictkion interval using regression coefficients

2011-04-12 Thread Joshua Wiley
Hi Zeda, The short answer to your question is no. All you have are the parameter estimates with no information on variability which you would need to create a prediction interval. Given the great ease of fitting models in R, I would offer to refit the model for my boss, and then (with the model

Re: [R] Assign Character Value to Data Frame

2011-04-12 Thread Sarah Goslee
That column of your data frame contains a factor, rather than character values. You don't tell us how you created the data frame, but you might be interested in the stringsAsFactors option to data.frame() and read.table(). Or, if you do actually want a factor for that column, you can use factor()

Re: [R] Assign Character Value to Data Frame

2011-04-12 Thread Joshua Wiley
Hi John, The error arises because the "hold" data frame contains factors. This happens by default when creating data frames with character data as you did. Factors have a set number of levels and new values cannot be assigned to them that fall outside their specified levels, hence the error. Th

[R] Assign Character Value to Data Frame

2011-04-12 Thread Sparks, John James
Dear R Helpers, I am trying to write a character value to the row of a data frame and am running into a problem that I don't have when I do this for numeric arguments. For example, the following works just fine: > test<-data.frame(number=numeric(1)) > test[1,]<-.5 > test number 10.5 But t

Re: [R] plot3d crashes R

2011-04-12 Thread Ben Bolker
gmail.com> writes: > > Hi Duncan, > > I've just read the help for the plot3d function you've written > and tried out the example code given at the > bottom of the page. I then modified the function by adding > an aspect ratio of 0.1 and ran it again, which > crashed my R. I am using 2.12.2 o

Re: [R] Using help in Windows version of R with disabled browser

2011-04-12 Thread Jonathan P Daily
try: options(help_type = 'text') ?options If this works, you can create a site profile (A default is created automatically in windows, if I remember correctly) where you can set this to run in each session. -- Jonathan P. Daily Technician - USGS Leetown Scien

[R] Predictkion interval using regression coefficients

2011-04-12 Thread Zd Gibbs
I was given a list of parameter estimates from my boss. She wants to predict the dependent variable "fsshen" beyond jan 2011, the last observation, through December 2011, giving the prediction intervals (90%). I don't know if I have the complete information to do this. So my question(s) is can

[R] Using help in Windows version of R with disabled browser

2011-04-12 Thread Ranjan Maitra
Dear colleagues, I am trying to get someone to use R on MS Windows with the browser disabled. My question is how does he/she get to use R-help which goes off the browser (and correspondingly complains about the inability to start firefox, etc). In linux, which is what I use, this is not a problem:

Re: [R] multiple lines on multiple plots

2011-04-12 Thread John Kane
Or perhaps this as an example of using lines() rather than just getting a line and dot output in the upper graph. x <- 1:10 y <- (1:100)*3 z <- rnorm(100, 150, sd= 75) a <- rnorm(10,mean=5, sd= 2.5) par(mfcol=c(2,1)) plot(x) lines(a, col= "red") plot(y) lines(z , col="blue") --- On Tue,

Re: [R] Datadist error

2011-04-12 Thread Frank Harrell
Please follow posting guide and provide a simple completely self-contained example showing the error. Then I'll take a look. Frank Sander wrote: > > Dear all, > > I have performed a simple logistic regression using the lrm function from > the Design library. Now I want to plot the summary, or

Re: [R] question about optim

2011-04-12 Thread Ben Bolker
chirine wolley hotmail.com> writes: > Dear R-users, I would like to use optim( ) to minimize a function > which depends on 4 parameters: 2 vectors, a scalar, and a matrix. > And I have a hard to define the parameters at the beginning of the > function, and then to call optim. Indeed, all the exa

Re: [R] Non linear Regression: "singular gradient matrix at initial parameter estimates"

2011-04-12 Thread Felix Nensa
Hi Mario, yes works great. Thanks! 2011/4/12 Mario Valle > Use a more realistic starting point instead of the default one: > > fit <- nls(yeps ~ p1 / (1 + exp(p2 - x)) * exp(p4 * x), > start=list(p1=410,p2=18,p4=-.03)) > > This works for me: > > fit > Nonlinear regression model > model: yeps ~

Re: [R] Non linear Regression: "singular gradient matrix at initial parameter estimates"

2011-04-12 Thread Mario Valle
Use a more realistic starting point instead of the default one: fit <- nls(yeps ~ p1 / (1 + exp(p2 - x)) * exp(p4 * x), start=list(p1=410,p2=18,p4=-.03)) This works for me: > fit Nonlinear regression model model: yeps ~ p1/(1 + exp(p2 - x)) * exp(p4 * x) data: parent.frame() p1

[R] understanding dump.frames; typo;

2011-04-12 Thread Matt Shotwell
When a function I have stop()s, I'd like it to return its evaluation frame, but not halt execution of the script. In experimenting with this, I became confused with dump.frames. From ?dump.frames: If ‘dump.frames’ is installed as the error handler, execution will continue even in non-

Re: [R] multiple lines on multiple plots

2011-04-12 Thread jim holtman
Instead of trying to go back to a previous plot, gather up all the data for the plots and generate each one with the appropriate data. This is much easier than trying to keep track of what the dimensions are. Also if the data you want to add is outside the plot, then you have issues with clipping;

Re: [R] Model checking for gam (mgcv) result

2011-04-12 Thread Simon Wood
The curve is caused by the zeroes in your data. raw.residual = response - fitted so if response=0 then raw.residual = -fitted. You get a curve, rather than a straight line, on the fitted vs residual plot because the residuals are standardised in a way that also depends on the fitted value. (

Re: [R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Doran, Harold
I gave you a solution for the triangular matrix. Can you explain why that is not what you need? > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Shawn Koppenhoefer > Sent: Tuesday, April 12, 2011 11:37 AM > To: r-help@r-project

Re: [R] Non linear Regression: "singular gradient matrix at initial parameter estimates"

2011-04-12 Thread Felix Nensa
Hi Peter, thank you for your reply. Now I see, that P3 is indeed redundand. But with the simplified model... fit = nls(yeps ~ p1 / (1 + exp(p2 - x)) * exp(p4 * x)) ...nls still produces the same error. Any ideas? Felix 2011/4/12 Peter Ehlers > On 2011-04-11 13:29, Felix Nensa wrote: > >> Hi,

Re: [R] lookup not working properly

2011-04-12 Thread Dimitri Liakhovitski
Thank you, Sarah. This seems to be working: a=c("ba ba","ca ca","da da", "lake lake, a", "lake lake, b","lake of","lama ca, a","lama ca, b","ma ma") b=c("ba ba","ca ca","OTHER", "lake lake, a", "lake lake, b","lake of","lama ca, a","lama ca, b","OTHER") myref<-data.frame(a=a, b=b) myref$a<-as.chara

Re: [R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Spencer Graves
For non-square matrices, see qr and svd. Spencer On 4/12/2011 8:43 AM, Doran, Harold wrote: There are easier solutions. Suppose you have a matrix A, such as: ### Use the info from lm() help ctl<- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt<- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,

Re: [R] extract element from list by rownames

2011-04-12 Thread B77S
I'm thinking this isn't what you want.. but also: > data.frame((srMT[[3]][1]))[b,][2] filter.vel2 MK_SP10.2503257 SB1_SP1 0.2075117 SB4_SP1 0.2358855 B77S wrote: > > This probably is not ideal, but this works on a list of mine.. > > ## so you can see the structure of my l

Re: [R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Shawn Koppenhoefer
BTW, The same solution can be found using SVD (Singular Value Decomposition) example, ## Define the matrix that we want to decompose into the product of a matrix and its transform M<-matrix(c(0.6098601, 0.2557882, 0.1857773, 0.2557882, 0.5127065, -0.1384238, 0.1857

Re: [R] In svm(), how to connect quantitative prediction result to categorical result?

2011-04-12 Thread Steve Lianoglou
Hi, On Tue, Apr 12, 2011 at 10:54 AM, Saeed Abu Nimeh wrote: > I trained a linear svm and did classification. looking at the model I > have, with a binary response 0/1, the decision values look like this: > head(svm.model$decision.values) > 2.5 > 3.1 > -1.0 > > looking at the fitted values > head

Re: [R] Converting a categorical variable to multiple dichotemousvariables

2011-04-12 Thread Jeremy Hetzel
Shane, Does this work? # Your simulated data subject=1:1000 treat=rbinom(1*1000,1,.13) gender=rbinom(1*1000,1,.5) eth=runif(1*1000, min=1, max=4) cogat=rnorm(1*1000, 100, 16) map=rnorm(1*1000, 200, 9) growth=0 simtest=data.frame (subject=subject, treat=treat, gender=gender, eth=round(eth,digits=

Re: [R] multiple lines on multiple plots

2011-04-12 Thread John Kane
Try this. === x<- 1:10 y<- (1:100)*3 par(mfcol=c(2,1)) plot(x, type="o") plot(y) === --- On Tue, 4/12/11, James Annan wrote: > From: James Annan > Subject: [R] multiple lines on multiple plots > To: r-help@r-project.org > Received: Tuesday, April 12, 2

Re: [R] Fast version of Fisher's Exact Test

2011-04-12 Thread Stefan Evert
> Is anyone aware of a fast way of doing fisher's exact test for a series of 2 > x 2 tables in R? The fisher.test is really slow if n1=1000 and n2 = 1000. If you don't require exact two-sided p-values (determined according to a likelihood criterion as in fisher.test), you can use the vectorised

Re: [R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Doran, Harold
There are easier solutions. Suppose you have a matrix A, such as: ### Use the info from lm() help ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) lm.D9 <- lm(we

Re: [R] lookup not working properly

2011-04-12 Thread Sarah Goslee
Dimitri, It isn't clear to me exactly what you are trying to do, but this might be closer. Note the stringsAsFactors argument I added to data.frame: I don't think you are likely to want factors for this application. Also, it's a bad idea to create a variable named c since that is the name of a fun

Re: [R] Bayesian PCA

2011-04-12 Thread Christian Hennig
Dear Lucy, not an R-related response at all, but if it's questionnaire data, I'd probably try to do dimension reduction in a non-automated way by defining a number of 10 or so meaningful scores that summarise your questions. Dimension reduction is essentially about how to aggregate the given i

Re: [R] Merge matrix

2011-04-12 Thread Kevin E. Thorpe
On 04/12/2011 10:54 AM, pankaj borah wrote: I have two matrices A and B dim (A) [1] 30380 104 dim(Bt) [1] 3038063 I want to combine both A and B to matrix C where dim(C) [1] 30380 167 How do I do that ? Assuming that Bt is the transpose of B and you want C = [A|Bt] you coul

Re: [R] Merge matrix

2011-04-12 Thread Kehl Dániel
?cbind should solve your problem 2011-04-12 07:54 keltezéssel, pankaj borah írta: > I have two matrices A and B > >> dim (A) > [1] 30380 104 > >> dim(Bt) > [1] 3038063 > > I want to combine both A and B to matrix C where >> dim(C) > [1] 30380 167 > > How do I do that ? > > > Regards, >

Re: [R] Fwd: CRAN problem with plyr-1.4.1

2011-04-12 Thread Hadley Wickham
> Then, can we have the ERROR message, please? > Otherwise the only explanation I can guess is that a mirror grabs the > contents of a repository exactly in the second the repository is updated and > that is unlikely, particularly if more than one mirror is involved. Isn't one possible explanation

Re: [R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Shawn Koppenhoefer
Hello. I found a solution that may interest others. Recall that my problem was how to use R to decompose a matrix into the product of a matrix and its transpose. or, symbolically: For known matrix M (3x3 matrix) and unknown matrix F and its transpose t(F) where F * t(F) = M det

[R] Merge matrix

2011-04-12 Thread pankaj borah
I have two matrices A and B > dim (A) [1] 30380   104 > dim(Bt) [1] 30380    63 I want to  combine both A and B to matrix C where >dim(C) [1] 30380   167 How do I do that ? Regards, Pankaj Barah Department of Biology, Norwegian University of Science & Technology (NTNU) Realfagbygget, N-

Re: [R] extract element from list by rownames

2011-04-12 Thread B77S
This probably is not ideal, but this works on a list of mine.. ## so you can see the structure of my list > str(srMT) List of 4 $ mode : chr "discrete" $ ks.stat : chr "mean" $ observed :List of 4 ..$ filter: num [1:13, 1:4] 0.213 0.207 0.144 0.311 0.24 ... .. ..- attr(*, "dimnames

Re: [R] forest + igraph ?

2011-04-12 Thread Samor Gandhi
Thanks, That is a nice one. Is there any option that I can plot the pooled estimate? Regards, Samor --- On Tue, 12/4/11, Viechtbauer Wolfgang (STAT) wrote: From: Viechtbauer Wolfgang (STAT) Subject: RE: [R] forest + igraph ? To: "Samor Gandhi" , "r-h...@stat.math.ethz.ch" Date: Tuesday, 12

Re: [R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)

2011-04-12 Thread Alal
Thanks Im not sure about the gamma, but a survival analysis seems appropriate, but does it work for factors and continuous covariates? Do you have to verify some conditions beforehand? -- View this message in context: http://r.789695.n4.nabble.com/1-continuous-non-normal-variable-4-factors-1-co

[R] Bayesian PCA

2011-04-12 Thread Lucy Asher
First of all I should say this email is more of a general statistics questions rather than being specific to using R but I'm hoping that this may be of general interest. I have a dataset that I would really like to use PCA on and have been using the package pcaMethods to examine my data. The re

[R] B %*% t(B) = R , then solve for B

2011-04-12 Thread Shawn Koppenhoefer
Hello,.. Apologies for the newbie question but... I have a matrix R, and I know that *B %*% t(b) = R* *I'm trying to solve for B *(aka. 'factoring the correlation matrix' I think) Please help! I've read that 'to solve for B we define the eigenvalues of R and then apply the techniques of Princip

[R] multiple lines on multiple plots

2011-04-12 Thread James Annan
I'm sure this must be trivial, but I'm a novice with R and can't work out how to handle the axes when I am constructing multiple plots on a page and try to return to a previous one to put multiple data sets it. A simple example: --- x<- 1:10 y<- (1:100)*3 par(mfcol=c(2,1)) plot(x) plot(y) par(

Re: [R] Fwd: CRAN problem with plyr-1.4.1

2011-04-12 Thread Ian Davis
Uwe, I really do appreciate the help from you and Douglas on resolving this problem. However, I respectfully disagree on a few points: - install.packages() was broken and failing to install successfully. This is why I was tracking down the URL via the CRAN website. - I think it's crazy to have

Re: [R] Fwd: CRAN problem with plyr-1.4.1

2011-04-12 Thread Ian Davis
2011/4/12 Uwe Ligges > On 12.04.2011 14:52, Ian Davis wrote: > >> I really do appreciate the help from you and Douglas on resolving this >> problem. However, I respectfully disagree on a few points: >> >> - install.packages() was broken and failing to install successfully. >> > > install.package

Re: [R] Fwd: CRAN problem with plyr-1.4.1

2011-04-12 Thread Uwe Ligges
On 12.04.2011 17:08, Ian Davis wrote: 2011/4/12 Uwe Ligges mailto:lig...@statistik.tu-dortmund.de>> On 12.04.2011 14:52, Ian Davis wrote: I really do appreciate the help from you and Douglas on resolving this problem. However, I respectfully disagree on a few poin

[R] lookup not working properly

2011-04-12 Thread Dimitri Liakhovitski
Hello! Below is my exmample. "myref" is my reference data frame with columns a and b. "temp" is my data with column c analogous to column a in "myref". I am trying to create a new variable b - in "temp" - that matches values from b in "myref" to values in c. If you look at the resulting data frame

Re: [R] plot - kamada.kawai layout without arrows

2011-04-12 Thread Gary Weissman
Hello, It appears you are using the igraph package. You can get rid of the arrows using a few different methods. You can make the graph undirected: new.graph <- as.undirected(old.graph) plot(new.graph) Or you can simply specify the size of the arrows as zero using either E(some.graph)$arro

Re: [R] Converting a categorical variable to multiple dichotemousvariables

2011-04-12 Thread Shane Phillips
Here is my original script. subject=1:1000 treat=rbinom(1*1000,1,.13) gender=rbinom(1*1000,1,.5) eth=runif(1*1000, min=1, max=4) cogat=rnorm(1*1000, 100, 16) map=rnorm(1*1000, 200, 9) growth=0 simtest=data.frame (subject=subject, treat=treat, gender=gender, eth=round(eth,digits=0), cogat=round

  1   2   >