Re: [R] get index of current element in vector

2012-06-05 Thread Erdal Karaca
Thanks all, that worked! Yes, it should be for (i in 1:length(a)) a[i]- scalar * a[i] * i And now is... a - a * scalar * seq_along(a) That is almost as cool as the PERL programming language :-) 2012/6/4 Rui Barradas ruipbarra...@sapo.pt Hello, Just learning the alphabet? If yes, there's a

[R] R Error : Error in vector(list, gamma(n + 1)) : vector size specified is too large

2012-06-05 Thread ritwik_r
Dear R-listers, I am giving part of my R code : ### n=15 m=1 library(partitions) library(gregmisc) library(combinat) x = t(restrictedparts(n-m,m)) l = length(x[,1]) for(u in 1:l){ A= unique(matrix( unlist(permn(x[u,])), ncol=m,

Re: [R] probit analysis

2012-06-05 Thread arun
Hi Trinh, Please check ?dose.p() from library MASS. Since you wanted the rate, the code was a bit modified from the example.  datPr    X Event Trial 1 1210.0 8 8 2  121.0 6 8 3   60.5 6 8  fm-glm(Event/Trial~X,data=datPr,family=quasibinomial(link=probit))  

Re: [R] Read txt File contains character 

2012-06-05 Thread climmi
Thank you ! Rui Barradas . Yes, the arrow character  can not be recoginised by R. the character will be treat as a stop command... So I replace all the character  with space, then it works.. Just want to know is there any way for R to handle it. Not sure does eveybody able to view the

[R] Merror

2012-06-05 Thread tkcasso
I have been try to work with Merror n I keep getting this message: Error in solve.default(H) : system is computationally singular: reciprocal condition number = 0 can some one please tell me what it mean and how to solve this. -- View this message in context:

Re: [R] Read txt File contains character 

2012-06-05 Thread peter dalgaard
On Jun 5, 2012, at 08:42 , climmi wrote: Thank you ! Rui Barradas . Yes, the arrow character  can not be recoginised by R. the character will be treat as a stop command... So I replace all the character  with space, then it works.. Just want to know is there any way for R to handle

[R] approximating matrix columns

2012-06-05 Thread eliza botto
Dear Gunter Berton and all, As you can see, my data has three lists each containing 366 entries. I converted them into the matrix. I now want to approx./interpolate 366 entries over 365 intervals, Which means I want to have a matrix with 365 entries. I used approx(matrix,

[R] Converiting longitude/latitude to utm

2012-06-05 Thread Boris Beranger
Dear all, I have been trying to convert coordinates from longitude/latitude to utm but I got an error. As soon as the longitude coordinate is greater than 90, I get the folloowing error message: error in pj_transform: latitude or longitude exceeded limits Here is what I did:

Re: [R] Merror

2012-06-05 Thread Özgür Asar
I believe that dozens of people asked this question before you. If you search this error in google, you can find your answer! Ozgur -- View this message in context: http://r.789695.n4.nabble.com/Merror-tp4632371p4632378.html Sent from the R help mailing list archive at Nabble.com.

[R] Need package which can parse linux configuration file '.conf'

2012-06-05 Thread Prakash Thomas
Hi, Please let me whether there is a package which can parse linux configuration file '.conf. If there is no specific package can any of the generic package handle this? Thanks Regards, Thomas [[alternative HTML version deleted]] __

Re: [R] Converiting longitude/latitude to utm

2012-06-05 Thread Michael Sumner
UTM needs a +zone and +south marker for the southern hemisphere, so your PROJ.4 specification is incomplete, probably assuming +zone=1 which is completely wrong for longitude=126. http://en.wikipedia.org/wiki/File:Utm-zones.jpg Longitude 126.59 suggests zone 51 or 52, but it really depends on

Re: [R] mgcv (bam) very large standard error difference between versions 1.7-11 and 1.7-17, bug?

2012-06-05 Thread Martijn Wieling
Dear useRs, Simon, @Simon: I'll send the data offline. The command summary(...,freq=F) yields the same result as before. Why did the default change from freq=F in version 1.7-13 to freq=T in version 1.7-17? Especially since the original default appeared to be better. I noticed that some of my

Re: [R] How to calculate chi sqaure value from statistical value and degrees of freedom?

2012-06-05 Thread Özgür Asar
Hi, Try pchisq(q,df) available at help(Chisquare) Ozgur -- View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-chi-sqaure-value-from-statistical-value-and-degrees-of-freedom-tp4632385p4632386.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Math labels in .eps files

2012-06-05 Thread Prof Brian Ripley
On 04/06/2012 17:25, Fredrik Karlsson wrote: Dear list, I have non-ascii labels that I want to include somethow in a .eps file for inclusion into a LateX document. Is this possible? What I see is that the (attached) png file looks ok but the .eps renders all non-ascii labels at the bottom as

Re: [R] how to ignore NA with NA or NULL

2012-06-05 Thread jeff6868
Thanks again but my errors are still here. Is it maybe coming from the next fonction (I combinate these 2 functions but I thought it was coming from the first one): process.all - function(df.list, mat){ f - function(station) na.fill(df.list[[ station ]], df.list[[

[R] [r] par and complex graph

2012-06-05 Thread Francesco Nutini
Dear R-Users, I'd like to have some tips about printing graph. I use the command par to print more graphs in one window:par(mfrow=c(6,1)); par(oma=c(2.5, 2.5, 2.5, 2.5)); par(mar=c(0.5,4, 0.5, 0.5)) But this command doesn't run with complex graphic command (i.e. xyplot, ternaryplot).How can

Re: [R] Read txt File contains character 

2012-06-05 Thread Rui Barradas
Hello, Yes, there are ways for R to handle it. You could use readChar/writeChar after openning the file in binary mode. Something like, len - file.info(test.txt)$size #len fc - file(test.txt, open=rb) s - readChar(fc, nchars=len, useBytes = TRUE) close(fc) #grep(\032, s) s - gsub(\032, , s)

Re: [R] approximating matrix columns

2012-06-05 Thread Rui Barradas
Hello, Try apply(mat, 2, approx, method=”linear”, n=365) This reads apply to each column (dimension = 2) of mat the function approx with extra args method and n. Three notes. 1. Your data does NOT have three list, it IS one list with three vectors. 2. 'matrix' is a function so choose

[R] N Gram in textcat

2012-06-05 Thread ashishkalra
Hi, I want to use N gram approach for assessing words association and their placing in a sentence. I have tried textcat package and the syntaxes but it deals with language classificaiton rather than a user defined classification. Can someone help me with this? Basically, I have these two

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test=Chisq)

2012-06-05 Thread lincoln
Thank you for your commentaries and suggestions. Site 0 and site 1 are interpretable like events. In fact these data come from a simultaneous observations of individuals in two different sites (so they are independent observations: while one individual is observed in one site it can't be in

Re: [R] Summarizing a matrix

2012-06-05 Thread Özgür Asar
Hi, x-matrix(0,80,ncol=1) will create x matrix with all elements 0 (to be filled by the sums that you need) sum(y[y[,4]==1,5]) will calculate the sum of 5th column of y with 4th column=1 Similarly, sum(y[y[,4]==80,5]) will calculate the sum of 5th column of y with 4th column=80. You can

[R] How to calculate chi sqaure value from statistical value and degrees of freedom?

2012-06-05 Thread Manish Gupta
Hi, How to calculate chi sqaure p value for given statistical value and degrees of freedom. Input : x = statistical value d = degrees of freedom output: p value = ? Regards -- View this message in context:

Re: [R] approximating matrix columns

2012-06-05 Thread eliza botto
Dear Rui, i am greatful for everything you did. bret advised me to use dput(), which i did. yes! i forgot to complement him. i literally feel sorry for that. i hope you wont mind and continue extending your help. regards and love for every one eliza botto waters inn Date: Tue, 5 Jun 2012

Re: [R] get index of current element in vector

2012-06-05 Thread Uwe Ligges
On 05.06.2012 00:36, Erdal Karaca wrote: Thanks all, that worked! Yes, it should be for (i in 1:length(a)) a[i]- scalar * a[i] * i And now is... a- a * scalar * seq_along(a) That is almost as cool as the PERL programming language :-) Almost? Uwe Ligges 2012/6/4 Rui

Re: [R] get index of current element in vector

2012-06-05 Thread jim holtman
Do we need an Obfuscated R contest? On Tue, Jun 5, 2012 at 8:17 AM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 05.06.2012 00:36, Erdal Karaca wrote: Thanks all, that worked! Yes, it should be for (i in 1:length(a)) a[i]- scalar * a[i] * i And now is... a- a * scalar *

Re: [R] get index of current element in vector

2012-06-05 Thread Uwe Ligges
On 05.06.2012 14:46, jim holtman wrote: Do we need an Obfuscated R contest? I already know potential winners Uwe On Tue, Jun 5, 2012 at 8:17 AM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 05.06.2012 00:36, Erdal Karaca wrote: Thanks all, that worked! Yes, it

[R] - help with the predict function

2012-06-05 Thread Joachim Audenaert
Hi all, I would like to predict some values for an nls regression function (functional response model Rogers type II). This is an asymptotic function of which I would like to predict the asymptotic value I estimated the paramters with nls, but can't seem to get predictions for values of m

[R] how to calculating the p vaules of Canonical correlation analysis in vegan package

2012-06-05 Thread Xinhui Wang
Dear R users, currently, i am working on the canonical correlation analysis (R package vegan or CCA). I have a trouble to calculate the pvalue of the association between each dependent variable and each independent variable, also i want to calculate the pvalue of the association between a

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test=Chisq)

2012-06-05 Thread David Winsemius
On Jun 5, 2012, at 4:52 AM, lincoln wrote: Thank you for your commentaries and suggestions. Site 0 and site 1 are interpretable like events. In fact these data come from a simultaneous observations of individuals in two different sites (so they are independent observations: while one

Re: [R] Converiting longitude/latitude to utm

2012-06-05 Thread David L Carlson
You might try R-Sig-Geo for the reasons, but you need to include the UTM zone to convert: SP-SpatialPoints(cbind(126.59,-14.30),proj4string=CRS(+proj=longlat)) SP SpatialPoints: coords.x1 coords.x2 [1,]126.59 -14.3 Coordinate Reference System (CRS) arguments: +proj=longlat

Re: [R] - help with the predict function

2012-06-05 Thread Ben Bolker
Joachim Audenaert Joachim.Audenaert at pcsierteelt.be writes: Hi all, I would like to predict some values for an nls regression function (functional response model Rogers type II). This is an asymptotic function of which I would like to predict the asymptotic value I estimated the

[R] ggplot2, grid graphics, x11(), windows(), and device fonts

2012-06-05 Thread Robert Baer
I am trying to use ggplot() to produce a graph and am getting warnings that I don't understand. This is happening from within RStudio, but also happens if I start Windows R GUI. Can anyone help me understand the warning and how to make sure the right fonts are designated? The relevant code

Re: [R] how to ignore NA with NA or NULL

2012-06-05 Thread Rui Barradas
Hello, I believe the error is in function 'g'. If I'm right, follow these steps 1. Just before the first if include flag - TRUE 2. Just before for(y in ord) include flag - FALSE 3. Just before break include flag - TRUE 3. Change the return value form simply x to if(flag) x else NA The code

[R] Fourier descriptors created in a loop

2012-06-05 Thread aledanda
Hi All, Here is the problem: I'm trying to generate a number of Fourier Descriptors figures for an experiment. All I need is that they are created within a loop and saved with sequential names (e.g., s1_1.png, s1_2.png etc..) in my directory. I created a nested loop with a counter for the

Re: [R] plot background - excel gradient style background ?

2012-06-05 Thread jcrosbie
I'm not the one who is choosing to use gradient background. It's our company policy. -- View this message in context: http://r.789695.n4.nabble.com/plot-background-excel-gradient-style-background-tp4632138p4632409.html Sent from the R help mailing list archive at Nabble.com.

[R] need descriptive help

2012-06-05 Thread mkm1616
Hi all, I'm new to using R, and apologize for simplicity of this question. I'm using a data set with over 60,000 observations, Two variables are patient ID, and cost incurred by the patient. I'd like to generate frequency/table by patient and cost IF the total cost is over 2000. Right now I'm

[R] nls: how do you know if the model is significant?

2012-06-05 Thread Nerak
Hi all, I'm struggling with nls. How do you know if your model is significant? For a lm, you get a p-value, but you don't get it for a nls. Is there a way to calculate it? For a lm I use this: a-summary(lm(model ~obs)) f.stat-a$fstatistic

Re: [R] multiple comparisons with generalised least squares

2012-06-05 Thread racmar
Hi Sandy, I was wondering if you ever recieved an answer regarding the use of multiple comparisons for gls models? I have also been searching various forums and books to see if there are any methods I could use and have only found people, such as yourself, asking the same question. Many thanks

[R] rowSums problem

2012-06-05 Thread alonis10
I'm having a very frustrating problem, trying to find the inverse distance squared weighted interpolants of some weather data. I have a data frame of weights, which sum to 1. I have attached the weights data. I also have a data frame of temperatures at 48 grid points, which I have also attached.

Re: [R] rowSums problem

2012-06-05 Thread alonis10
http://r.789695.n4.nabble.com/file/n4632406/temp3880.csv temp3880.csv http://r.789695.n4.nabble.com/file/n4632406/weight3880.csv weight3880.csv Here are the files I promised to upload. -- View this message in context: http://r.789695.n4.nabble.com/rowSums-problem-tp4632405p4632406.html Sent

Re: [R] need descriptive help

2012-06-05 Thread Bert Gunter
1. Before you post to this list again, please read An Introd to R -- or other basic R tutorial. Intro ships with every R installation. There's a reason for this -- to avoid badgering this list with basic R queries that minimal homework could answer. 2. However, see also ?table and links therein.

Re: [R] nls: how do you know if the model is significant?

2012-06-05 Thread Bert Gunter
I suggest you consult a local statistician. You could also post to a statistical help list like stats.stackexchange.com. Your query has nothing to do with R, but is rather about the meaningfulness (or lack thereof) of statistical significance in nonlinear modeling. -- Bert On Tue, Jun 5, 2012 at

Re: [R] need descriptive help

2012-06-05 Thread Rui Barradas
Hello, Try Total - aggregate(cost~patient, data=x) Total[Total$cost 1000, ] As for writing to a csv file, see ?write.csv Hope this helps, Rui Barradas Em 05-06-2012 16:34, mkm1616 escreveu: Hi all, I'm new to using R, and apologize for simplicity of this question. I'm using a data set

[R] NADA Applied to my Data

2012-06-05 Thread Rich Shepard
I need a nudge in the right direction to get started using NADA. I bought Helsel's second addition and am currently reading it; NADA is installed in R. My data has been restructured with a couple of awk scripts. The data frame structure now has a flag if the quantity is censored (ceneq1

Re: [R] community finding in a graph and heatplot

2012-06-05 Thread Aziz, Muhammad Fayez
Superb. It works. The results loo great. I just tweaked the function a little bit to suit my needs though. I passed merges and vcount separately as fgc$merges and vcount(g). The vcount attribute was not there in fgc object. Also, I removed the last row from the merges matrix before returning

Re: [R] [r] par and complex graph

2012-06-05 Thread Prof Brian Ripley
On 05/06/2012 11:17, Francesco Nutini wrote: Dear R-Users, I'd like to have some tips about printing graph. I use the command par to print more graphs in one window:par(mfrow=c(6,1)); par(oma=c(2.5, 2.5, 2.5, 2.5)); par(mar=c(0.5,4, 0.5, 0.5)) But this command doesn't run with complex

[R] propensity score matching estimates?

2012-06-05 Thread Dustin Fife
I'm using the Match package to do propensity score matching. Here's some example code that shows the problem that I'm having (much of this code is taken from the Match package documentation): *data(lalonde) glm1 - glm(treat~age + I(age^2) + educ + I(educ^2) + black + hisp + married

Re: [R] registry vulnerabilities in R

2012-06-05 Thread Paul Martin
Update: The IT people agreed to test R separately. R is now approved and RStudio is not. The folks at RStudio are baffled as to why all those registry entries are being recorded. They directed me to the source code which details the known accesses to the registry during installation. I have

Re: [R] Non-linear curve fitting (nls): starting point and quality of fit

2012-06-05 Thread Greg Snow
One thing to note is that there are more than one model that can be called exponential. Two of the common ones are: y = exp( a + b*x + error ) y = exp( a + b*x ) + error The common way to fit the first is to take the log of both sides and just fit a linear model with log(y), I expect (but am

Re: [R] Fourier descriptors created in a loop

2012-06-05 Thread David Winsemius
On Jun 5, 2012, at 11:50 AM, aledanda wrote: Hi All, Here is the problem: I'm trying to generate a number of Fourier Descriptors figures for an experiment. Somehow I'm guessing that this will involve load an unnamed package. Yep: ?create.fourier.descriptor No documentation for

Re: [R] rowSums problem

2012-06-05 Thread Rui Barradas
Hello, The files you've uploaded are the weights file and the results file, not the original temp.csv. So this is untested but it seems you have a standard matrix multiply problem. temp3880W - temp[, 3:50] %*% weight3880 Hope this helps, Rui Barradas Em 05-06-2012 15:48, alonis10

Re: [R] rowSums problem

2012-06-05 Thread John Kane
I am having a problem visualizing what you are doing here. What I see is a temp file of 760 elements. From my point of view and reading in your data it would have a have dim(760, 1) but your code seems to suggest that it is not a single vector. Again I must be missing something completely

[R] Good Decision Trees with Product Purchased Data?

2012-06-05 Thread VikR
A client has inquired about producing a decision tree from data which could include: - ID of brand purchased - Importance ratings (1-10 scale) for a number of relevant attributes (price, strength, recommended by a friend, etc.) In other words, a rating of how important each attribute is in the

Re: [R] Good Decision Trees with Product Purchased Data?

2012-06-05 Thread Bert Gunter
Post on a statistics or data mining discussion site (e.g. stats.stackexchange.com). There are tons of different algorithms for fitting decision trees, and you are more likely to get an informative discussion on their relative strengths and weaknesses there than here. This is really NOT an R

[R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread Michael
Hi all, How do I obtain the current active path of a function that's being called? That's to say, I have several source files and they all contain definition of function A. I would like to figure out which function A and from which file is the one that's being called and is currently active?

Re: [R] Seeking pointers to various regression techniques with R?

2012-06-05 Thread Michael
I read your website but still don't know the difference between the three formulas... Thank you! On Mon, Jun 4, 2012 at 11:14 PM, Joshua Wiley jwiley.ps...@gmail.comwrote: Hi Michael, This is far from exhaustive (I wrote it as an introduction some years ago) but you may find it useful to

Re: [R] Regions of significance plots with ggplot2

2012-06-05 Thread Paul Murrell
Hi Here's one way to approach it ... ggplot(data.frame(x=1:10, y=1:10)) + geom_polygon(aes(x=xx, y=yy), fill=grey70, data=data.frame(xx=c(0, 0, 4, 4), yy=c(0, 11, 11, 0))) + geom_point(aes(x=x, y=y)) ... (supply a separate data source for the background region polygon).

Re: [R] Regions of significance plots with ggplot2

2012-06-05 Thread baptiste auguie
Hi, On 6 June 2012 08:58, Paul Murrell p.murr...@auckland.ac.nz wrote: Hi Here's one way to approach it ... ggplot(data.frame(x=1:10, y=1:10)) +  geom_polygon(aes(x=xx, y=yy), fill=grey70,               data=data.frame(xx=c(0, 0, 4, 4), yy=c(0, 11, 11, 0))) +  geom_point(aes(x=x, y=y))

Re: [R] Good Decision Trees with Product Purchased Data?

2012-06-05 Thread VikR
Define: one (who?) The individual analyzing the data. Define: usually More than 50% of the time. Define: good A decision tree including branches on at least 2 variables. Define: data of this kind I believe I may have specified this in my original post: - ID of brand purchased -

Re: [R] plot background - excel gradient style background ?

2012-06-05 Thread Greg Snow
Well that answers the question as answer. So while you are working within the system to get your company to change the policy you can use rasterImage to add a gradient background to the plot, then use points or lines or other functions to put the parts of interest back on top of the gradient (if

Re: [R] Seeking pointers to various regression techniques with R?

2012-06-05 Thread Andrew Miles
The R book by Michael Crawley has some discussion the type of R syntax you are looking for in the chapter on statistical modeling. As for the formulae you gave... lm(y ~ x*w - 1) fits an interaction between x and w without an intercept, along with the main effects for x and w lm(y ~ x:w - 1)

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread Greg Snow
There are several ways that a function can come into being within R, it can be sourced from a file like in your case, but it could also be typed in by hand at the command prompt, or created by another function, etc. So R does not in general keep links to the files from which the file was

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread Andrew Miles
Can you provide an example of the code file that you use to call the different functions? Without that it might be hard for people to answer your question. Offhand, I'd say that it is whatever version of function A was called last. If you are loading functions into the workspace, they are

Re: [R] Seeking pointers to various regression techniques with R?

2012-06-05 Thread Peter Ehlers
You mention 3 models. In all of them, the '-1' simply removes the intercept term; help('formula') explains the use of '-' in general. 1. lm(y~ x * w - 1) is clearly explained in help('formula'); 2. lm(y~ x:w - 1) ditto (and this is a model to avoid); 3. lm(y~ x/w - 1) this is equivalent to

Re: [R] Seeking pointers to various regression techniques with R?

2012-06-05 Thread Michael
Thank you! But could you please explain why the 2nd formula is a model to avoid? Thanks again! On Tue, Jun 5, 2012 at 6:18 PM, Peter Ehlers ehl...@ucalgary.ca wrote: You mention 3 models. In all of them, the '-1' simply removes the intercept term; help('formula') explains the use of '-' in

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread Michael
Thanks so much for your help! I'd like but however I couldn't provide the code since they are not in public domain... But lets imagine I inherited a big pile of R projects/codes from other people and there are lots of sources in the programs. And there are many definitions of function A in the

Re: [R] Seeking pointers to various regression techniques with R?

2012-06-05 Thread Bert Gunter
OY! Have you had any courses in linear models/regression? If so, it's the so-called effects hierarchy principle: generally one does not expect interactions -- 2nd order effects -- when main effects -- first order effects -- are absent. If not, it's difficult to explain, but it certainly has

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread David Winsemius
On Jun 5, 2012, at 7:51 PM, Michael wrote: Thanks so much for your help! I'd like but however I couldn't provide the code since they are not in public domain... But lets imagine I inherited a big pile of R projects/codes from other people and there are lots of sources in the programs. And

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread Richard M. Heiberger
I think your best option is to invest time in learning how to build an R package, and then package each project. Conflicting names are not a problem when you have them inside package namespaces. See the extensions document in R in the R distribution R-2.15.0/doc/manual/R-exts.html One way to

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread David Winsemius
On Jun 5, 2012, at 8:35 PM, arun wrote: Hi Dave, I am interested in your suggestion. But, look at this scenario. func-function()x comment(func)-test comment(func) [1] test func-function()y comment(func)-test2 comment(func) [1] test2 func-function()x comment(func) NULL

[R] GSL Random Number generation and Quasi-Random Sequences.

2012-06-05 Thread Keith Weintraub
Folks, Can you point me to any examples of using the GSL library to generate correlated uniform random variables? I want to generate correlated defaults among portfolios of loans. Currently I generate simulations by using rmvsnorm (and then inverting using the standard normal distribution

Re: [R] Converiting longitude/latitude to utm

2012-06-05 Thread Boris Beranger
Thank you David Michael for your answers. It makes more sense now! Cheers, Boris 2012/6/6 David L Carlson dcarl...@tamu.edu You might try R-Sig-Geo for the reasons, but you need to include the UTM zone to convert: SP-SpatialPoints(cbind(126.59,-14.30),proj4string=CRS(+proj=longlat)) SP

Re: [R] How to calculate chi sqaure value from statistical value and degrees of freedom?

2012-06-05 Thread Özgür Asar
Hi, Actually, pchisq(q,df) calculates the cumulative distribution function by default. To calculate the p-value, you can use either 1-pchisq(q,df) or pchisq(q,df,lower.tail=FALSE) PS: I checked, the p value yielded by R and the calculator for which you give a link, for some q and df values,

[R] How to Rank clusters

2012-06-05 Thread shilpi harpavat
Hi, I have say 1000 different Independent Variables which have each been classified into diiferent clusters using some clustering method. I want to show these 1000 varaible in a report, but want some criterion to rank them so i can show the most significant ones (based on the cluster groups)

Re: [R] Summarizing a matrix

2012-06-05 Thread Rui Barradas
Hello, Better yet is function aggregate. # Create some data matrix Y - matrix(c(sample(80, 507, TRUE), sample(-1:1, 4*507, TRUE)), ncol=5) X - aggregate(Y[, 5]~Y[, 1], Y, sum) # In your case Y[, 4] not Y[, 1] Hope this helps, Rui Barradas Em 05-06-2012 09:53, Özgür Asar escreveu: Hi,

[R] load coda in BRugs to perfor diagnostics

2012-06-05 Thread Guillaume2883
Dear all, I just wrote a script to have each of my three mcmc chins running on a different computer core to improve computation speed. To do it I use the function sfLapply from the package snowfall. Before using parallell computation, I did my diagnostic analyses just after the model updating,

[R] Do YOU know an equation for splines (ns)?

2012-06-05 Thread Ranae
Hi, I am looking at the change in N concentration in plant roots over 4 time points and I have fit a spline to the data using ns and lme: fit10 - lme( N~ns(day, 3), data = rcn10G) I may want to adjust the model a little bit, but for now, let's assume it's good. I get output for the fixed

Re: [R] need descriptive help

2012-06-05 Thread mkm1616
Was it really necessary to reply with sarcasm i.e. badgering the list. The point of an open community is to seek advice. i mentioned I was new to R and apologized to the community. A simple response with some guidance would be helpful. I'm looking at other posts, there are some other simple

Re: [R] need descriptive help

2012-06-05 Thread arun
Hi, Try this example: set.seed(1) dat2-data.frame(patient=rep(c(1:20),5),cost=rnorm(100,15,1)) agg1-aggregate(dat2,by=list(dat2$patient),FUN=sum)  agg2-agg1$cost 75 agg3-data.frame(agg1[agg2,2:3]) A.K. - Original Message - From: mkm1616 mkm1...@gmail.com To: r-help@r-project.org Cc:

Re: [R] nls: how do you know if the model is significant?

2012-06-05 Thread mkm1616
Here goes bert again with etiquette lessons. Why are you so crabby? On Jun 5, 11:16 am, Bert Gunter gunter.ber...@gene.com wrote: I suggest you consult a local statistician. You could also post to a statistical help list like stats.stackexchange.com. Your query has nothing to do with R, but

[R] Improper coding for an offset in vglm()?

2012-06-05 Thread Christopher R. Dolanc
Hello R-help. I believe I may be coding the offset incorrectly in my formula. I am testing significance between different group pairings using the VGAM package. My data are zero-truncated and poisson-distributed and overdispersed, so I'm using the posnegbinomial function in vglm (code

Re: [R] need descriptive help

2012-06-05 Thread mkm1616
Thank you Rui. Appreciate the help. Apologies for badgering the msg board. lol On Jun 5, 11:28 am, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Try Total - aggregate(cost~patient, data=x) Total[Total$cost 1000, ] As for writing to a csv file, see ?write.csv Hope this helps, Rui

[R] Trouble with Functions

2012-06-05 Thread dougmcintosh
Hi guys, I'm a new to R and following along with Tutorials using this book: http://www.amazon.com/Practical-Statistical-Analysis-Non-structured-Applications/dp/012386979X In one of them, they use the twitteR package and describe the following function (see below). From what I can tell from the

Re: [R] need descriptive help

2012-06-05 Thread arun
Hi, Oops! I selected the wrong columns in the previous reply. Try this:  set.seed(1)    dat2-data.frame(patient=rep(c(1:20),5),cost=rnorm(100,15,1))  agg1-aggregate(dat2,by=list(dat2$patient),FUN=sum)   agg2-agg1$cost 75  agg3-data.frame(agg1[agg2,c(1,3)])  names(agg3)-c(patient,cost)  agg3

Re: [R] Trouble with Functions

2012-06-05 Thread dougmcintosh
FYI - here are the errors (I can get rid of the first one by removing the progress parameter - which I understand controls whether a progress bar is displayed). The second one stops at the gsub call. Maybe if someone could give me a properly formatted example I could work from instead? Thanks!

[R] preserving date formats in functions

2012-06-05 Thread jween
Hi there! I have two date columns in a dataframe I need to selectively collapse based on missing values and which date comes first (imported from an text file). This is what I did: RHSSP$CT- as.POSIXct(RHSSP$CT, format='%m/%d/%y %H:%M') RHSSP$MRI

Re: [R] rowSums problem

2012-06-05 Thread alonis10
This is precisely what I needed; I can't believe how simple it is. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/rowSums-problem-tp4632405p4632461.html Sent from the R help mailing list archive at Nabble.com. __

[R] Piecewise Lasso Regression

2012-06-05 Thread Lucas Santana dos Santos
Hi All, I am trying to fit a piecewise lasso regression, but package Segmented does not work with Lars objects. Does any know of any package or implementation of piecewise lasso regression? Thanks, Lucas __ R-help@r-project.org mailing list

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread arun
Hi Dave, I am interested in your suggestion.  But, look at this scenario. func-function()x comment(func)-test comment(func) [1] test func-function()y comment(func)-test2 comment(func) [1] test2 func-function()x comment(func) NULL func-function()y comment(func) NULL Does it imply

[R] How to compute boundaries for bivariate normal distribution in group sequential design

2012-06-05 Thread jeka12386
Hi all Dear all, I need to compute boundaries for 3 stages group sequential design with 2 variables using Simpson’s integration method. There is a r program written by Michael A. Proschant et Al. (2006) (Statistical Monitoring of Clinical Trials: A Unified Approach) – see file attached – to

[R] ggplot incorrect legend

2012-06-05 Thread jcrosbie
How do I create a legend with ggplot? I think should be getting the FuelTypeNum in the legend. Plot: http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg My code is: ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) + geom_bar(position=stack, stat=identity) +

Re: [R] How to calculate chi sqaure value from statistical value and degrees of freedom?

2012-06-05 Thread Manish Gupta
Hi, My input is chi square statistical value and degrees of freedom. But i m getting different p values with the above formula. I double checked my values with the below calculator. http://vassarstats.net/tabs.html#csq Pls help me out. -- View this message in context:

[R] Combine subsets by factor level

2012-06-05 Thread lglucia
I'm attempting to change a data set by compressing rows into columns. Currently there are several rows that all have information about one patient, but at different cycles. I'm trying to make each patient only have one row in the data set. Does anyone know a good way to combine data sets by

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread Greg Snow
You can use the debug, fix, or edit functions to insert break points into the version of the function in memory without needing to edit the original source code. On Tue, Jun 5, 2012 at 5:51 PM, Michael comtech@gmail.com wrote: Thanks so much for your help! I'd like but however I couldn't

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-05 Thread Bert Gunter
See also ?trace ,?debugger, ?traceback and links therein. -- Bert On Tue, Jun 5, 2012 at 9:48 PM, Greg Snow 538...@gmail.com wrote: You can use the debug, fix, or edit functions to insert break points into the version of the function in memory without needing to edit the original source code.

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-05 Thread Bert Gunter
Does ?predict.ns not do what you want without having to explicitly manipulate the spline basis? -- Bert On Tue, Jun 5, 2012 at 1:56 PM, Ranae ranae.diet...@gmail.com wrote: Hi, I am looking at the change in N concentration in plant roots over 4 time points and I have fit a spline to the data

Re: [R] Ifelse on matrix using a vector argument

2012-06-05 Thread Özgür Asar
Hi, A practical way migh be out-rep(matrix(arg),4)-ma out[2,]--out[2,];out[5,]--out[5,] out [,1] [,2] [,3] [,4] [1,] 0.8 0.4 0.80 1.0 [2,] 1.0 0.0 1.00 0.3 [3,] 0.7 0.9 0.65 1.0 [4,] 1.0 0.5 0.60 0.9 [5,] 0.5 1.0 0.00 1.0 Best Ozgur -- View this message in context:

Re: [R] Math labels in .eps files

2012-06-05 Thread Fredrik Karlsson
Dear Professor Ripley, Thank you for your prompt answer. Indeed, cairo_ps solved the problem for me. Thank you! Fredrik 5 jun 2012 kl. 11:51 skrev Prof Brian Ripley rip...@stats.ox.ac.uk: On 04/06/2012 17:25, Fredrik Karlsson wrote: Dear list, I have non-ascii labels that I want to