Re: [R] plotting functions of chi square

2010-08-17 Thread maiya
Thanks, but that wasn't what I was going for. Like I said, I know how to do a simple chi-square density plot with dchisq(). What I'm trying to do is chi-square / degrees of freedom. Hence rchisq(10,i)/i). How do I do that with dchisq? -- View this message in context: http://r.789695.n4.na

Re: [R] plotting functions of chi square

2010-08-17 Thread Dennis Murphy
Hi: On Tue, Aug 17, 2010 at 2:28 PM, maiya wrote: > > Thanks, but that wasn't what I was going for. Like I said, I know how to do > a > simple chi-square density plot with dchisq(). > > What I'm trying to do is chi-square / degrees of freedom. Hence > rchisq(10,i)/i). > > How do I do that wi

Re: [R] plotting functions of chi square

2010-08-17 Thread Rookie
x <- seq(from = 0, to = 10, by = .01) plot(x, dchisq(x = x, df = 1), main = "title", sub = "subtitle", type = "l", xlab = "x-title", ylab = "y-title", ylim = c(0, .4), col = "red") lines(x, dchisq(x = x, df = 2), type = "l", col = "green") lines(x, dchisq(x = x, df = 3), type = "l", col = "blue")

Re: [R] plotting functions of chi square

2010-08-17 Thread Ben Bolker
maiya gmail.com> writes: > Thanks, but that wasn't what I was going for. Like I said, I know how to do a > simple chi-square density plot with dchisq(). > > What I'm trying to do is chi-square / degrees of freedom. Hence > rchisq(10,i)/i). > > How do I do that with dchisq? By explicitl

Re: [R] AIC in MuMIn

2010-08-17 Thread elaine kuo
Thank you. Most of the answers solved the puzzles. Q2 > > I tried to display sub-model with only temp_ran using the code below but > > failed. > > Please kindly suggest the potential failure cause. > > > > code > > > > library(MuMIn) > > datam <-read.csv("c:/migration/Mig_ratio_20100817.csv",hea

[R] HMisc/rms package questions

2010-08-17 Thread Rob James
1) How does one capture the plots from the plsmo procedure? Simply inserting a routing call to a graphical device (such as jpeg, png, etc) and then running the plsmo procedure (and then dev.off()) does not route the output to the file system. 1b) Related to above, has anyone thought of revising

Re: [R] plotting functions of chi square

2010-08-17 Thread David Winsemius
On Aug 17, 2010, at 5:28 PM, maiya wrote: Thanks, but that wasn't what I was going for. Like I said, I know how to do a simple chi-square density plot with dchisq(). What I'm trying to do is chi-square / degrees of freedom. Hence rchisq(10,i)/i). How do I do that with dchisq? Maybe

[R] replace loops with matrix

2010-08-17 Thread Hey Sky
Hey, R users I am using numerical method for my research paper and the computation burden is very heavy. first I tried to do it with loops, example code as following, and it take hours to converge for only 200 obs. and my real data has 4000 obs. and the optimization command that I use is: o

Re: [R] replace loops with matrix

2010-08-17 Thread Nikhil Kaza
what is nt? is that a typo for ns? I don't see why you need to calculate lia within the loop. Also library(fBasics) ccl <-rowprod(lia) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 17, 2010, at 6:22 PM, Hey Sky wrote: He

[R] Sweave

2010-08-17 Thread Randall Wrong
Dear R users, I am using Sweave. I would like to use the width option for the graphics : \begin{figure}[h!] \centering \includegraphics[width=0.7\textwidth]{x} \end{figure} How do I get this ? Thank you very much, Randall [[alternative HTML version deleted]] _

Re: [R] HMisc/rms package questions

2010-08-17 Thread David Winsemius
On Aug 17, 2010, at 5:53 PM, Rob James wrote: 1) How does one capture the plots from the plsmo procedure? Simply inserting a routing call to a graphical device (such as jpeg, png, etc) and then running the plsmo procedure (and then dev.off()) does not route the output to the file system. 1

Re: [R] HMisc/rms package questions

2010-08-17 Thread Frank Harrell
Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt University On Tue, 17 Aug 2010, Rob James wrote: 1) How does one capture the plots from the plsmo procedure? Simply inserting a routing call to a graphical devic

Re: [R] Sweave

2010-08-17 Thread Abhijit Dasgupta
Please read the Sweave documentation. The default is set to 0.8\textwidth. You have to change a \SweaveOpt. On Aug 17, 2010 7:00 PM, "Randall Wrong" wrote: Dear R users, I am using Sweave. I would like to use the width option for the graphics : \begin{figure}[h!] \centering \includegraphics[w

Re: [R] plotting functions of chi square

2010-08-17 Thread maiya
OK, for the record, this is not my homework, thanks for asking! Also, I am sure I could have phrased my question more eloquently, but (hence the newbie qualifier) I didn't. The code I posted was for the plot I want, only smoothed i.e not based on random sampling from the distribution. Dennis:

[R] what does it mean when my main effect 'disappears' when using lme4?

2010-08-17 Thread Johan Jackson
Hello, Setup: I have data with ~10K observations. Observations come from 16 different laboratories (labs). I am interested in how a continuous factor, X, affects my dependent variable, Y, but there are big differences in the variance and mean across labs. I run this model, which controls for mean

Re: [R] what does it mean when my main effect 'disappears' when using lme4?

2010-08-17 Thread Mitchell Maltenfort
One difference is that the random effect in lmer is assumed -- implicitly constrained, as I understand it -- to be a bell curve. The fixed effect model does not have that constraint. How are the values of "labs" effects distributed in your lm model? On Tue, Aug 17, 2010 at 8:50 PM, Johan Jackson

Re: [R] Missing values

2010-08-17 Thread Stephen Liu
- Original Message From: Robert Baer To: Stephen Liu ; r-help@r-project.org Sent: Wed, August 18, 2010 2:43:27 AM Subject: Re: [R] Missing values Hi Robert, - snip - >> z <- c(1:3,NA); ind <- is.na(z) ># To see the logical vector the same size as the original print them out ># z h

[R] About scan

2010-08-17 Thread Stephen Liu
Hi folks, I followed an online example to input data; > x = scan(1,2,3,4,5) Error in scan(1, 2, 3, 4, 5) : either specify 'nmax' or 'n', but not both. It can't work. > x = c(1,2,3,4,5) > x [1] 1 2 3 4 5 It works. Whether "scan" is replaced with "c" ? > ?c . Usage: c(..., recur

[R] Plot in cartesian plane

2010-08-17 Thread Pablo Cerdeira
Hi all, I'm trying to plot this two curves in a single cartesian plane, but when I plot the first one, the plot appears with no negative "y" value. When I plot the second curve, it almost does not apear in the graph. I was trying the plot.window but with no success. Can someone help me with this

Re: [R] About scan

2010-08-17 Thread Joshua Wiley
Hi Stephen, Maybe it is just me, but I am not clear what your question is. scan() is a function with a variety of arguments. When these are not explicitly named, they go in order. So, scan(1, 2, 3, 4, 5) is equivalent to scan(file = 1, what = 2, nmax = 3, n = 4, sep = 5), which is clearly nonse

[R] rJava: System.exit(1) in Java causes R crash

2010-08-17 Thread Sigal Blay
I'm writing a package that successfully calls Java from R using rJava. When R sends my Java function bad data (through .jcall()), I get the error message details (when I run it on a console) and then: Java requested System.exit(1), closing R. Is there a way to call .jcall so that when Java recei

Re: [R] About scan

2010-08-17 Thread Stephen Liu
- Original Message From: Joshua Wiley To: Stephen Liu Cc: r-help@r-project.org Sent: Wed, August 18, 2010 12:10:51 PM Subject: Re: [R] About scan Hi Josh, Thanks for your advice. - snip - >> x <- scan() >1: 1 2 3 4 5 >6: I tried it before. It'll continue asking for input unless pr

Re: [R] About scan

2010-08-17 Thread Joshua Wiley
On Tue, Aug 17, 2010 at 9:20 PM, Stephen Liu wrote: > - Original Message > > From: Joshua Wiley > To: Stephen Liu > Cc: r-help@r-project.org > Sent: Wed, August 18, 2010 12:10:51 PM > Subject: Re: [R] About scan > > Hi Josh, > > Thanks for your advice. > > - snip - > >>> x <- scan() >>1

Re: [R] replacing values in a vector

2010-08-17 Thread Karen Kotschy
Thanks so much to all those who suggested solutions! You guys are wonderful! I went with Dimitris' suggestion in the end. Regards Karen On Tue 17Aug10, Dimitris Rizopoulos wrote: > try this: > > vec <- c(3,2,6,4,7) > > n <- length(vec) > for(i in seq_along(vec)){ > r <- numeric(n) > r

[R] Matrix Dimnames

2010-08-17 Thread Rookie
Is there a way that I can specify the column names in the matrix function? Currently, below is the way I am doing it. x <- matrix(c(15, 7, 20, 12, 25, 14, 30, 19, 35, 7, 15, 7, 20, 17, 25, 19, 30, 25, 35, 10, 15, 15, 20, 12, 25, 19, 30, 22, 35, 11, 15, 11, 20, 18, 25, 18, 30, 19, 35, 15, 15, 9,

[R] svyquantile w/ svyby is returning an error

2010-08-17 Thread Marc Zodet
svymean w/ svyby is working for me... > svyby(~visitcnt, ~agegrp3.f, svymean, design=svydes) agegrp3.f visitcnt se.visitcnt 18-44 18-44 8.72 0.4953235 45-64 45-64 10.131555 0.5347806 65+ 65+ 9.588802 0.4323629 svyquantile is working for me... > svyquantile(~vis

[R] ask for help about netcdf

2010-08-17 Thread mat chueng
hi,r project I am a new user who has some questions about r tool,I have some original data file in netcdf format which is a famous geometry data file format, The file contains very large weather information from every zone of the world,I want to extract only a part of them to calcuate, like the

[R] column names only

2010-08-17 Thread R Newbie
Does anyone know how to assign (column names only) to a matrix? __ 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/posting-guide.html and provide commented, minimal,

[R] Matrix

2010-08-17 Thread Rookie
How do I completely remove the first column? (x <- matrix(c(1, 44, 124, 80, 254, 70, 190, 0, 2, 35, 110, 70, 240, 73, 216, 0, 3, 41, 114, 80, 279, 68, 178, 0, 4, 31, 100, 80, 284, 68, 149, 0, 5, 61, 190, 110, 315, 68, 182, 1, 6, 61, 130, 88, 250, 70, 185, 0, 7, 44, 130, 94, 298, 68, 161, 0, 8,

Re: [R] Sweave

2010-08-17 Thread Karen Kotschy
Dear Randall I do it like this: \begin{center} \setkeys{Gin}{width=0.7\textwidth} \begin{Scode}{fig=T, echo=F} ... \end{Scode} \end{center} Hope this helps. Karen On Wed 18Aug10, Randall Wrong wrote: > Dear R users, > > I am using Sweave. > > I would like to use the width opti

[R] Might be useful

2010-08-17 Thread Rookie
I came across this site and thought to pass it along http://www.rseek.org/ __ 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/posting-guide.html and provide commente

Re: [R] Plot in cartesian plane

2010-08-17 Thread Charles C. Berry
On Wed, 18 Aug 2010, Pablo Cerdeira wrote: Hi all, I'm trying to plot this two curves in a single cartesian plane, but when I plot the first one, the plot appears with no negative "y" value. When I plot the second curve, it almost does not apear in the graph. I was trying the plot.window but w

Re: [R] column names only

2010-08-17 Thread Jorge Ivan Velez
Take a look at ?colnames HTH, Jorge On Tue, Aug 17, 2010 at 9:08 PM, R Newbie wrote: > Does anyone know how to assign (column names only) to a matrix? > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE

[R] p-value from fisher.test odds ratio 'estimate' (without 2x2 table)

2010-08-17 Thread dschruth
Hello, I'm trying to generate a p.value directly from the output of a fisher exact test odds ratio statistic without resorting to performing another test on the 2x2 table itself. The motivation for this stems from a need to modify the test statistic before calculating it's new p- value. I've lo

[R] How to Perform CCA in ??!! Help please

2010-08-17 Thread stompper33
Performing CCA in R I know they say don't say please... or plead...but I'm sorry but I really need some help with this problem. I have tried to perform CCA in R and I can never do this successfully. Can someone please tell me what I'm doing wrong. I can't attach any file...so Please email me and

Re: [R] Rows index/colProds

2010-08-17 Thread pablo.andrade
Hi Henrik, My sessionInfo() is: R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1

Re: [R] Matrix

2010-08-17 Thread Joshua Wiley
Hi Rookie, Just as a note, it is generally nicer if you just provide the list with some sample data that illustrates your problem. This should answer your question: # mymatrix <- matrix(1:9, ncol = 3) mymatrix mymatrix <- mymatrix[, -1] #remove column 1 mymatrix # See ?'[' for d

Re: [R] Matrix Dimnames

2010-08-17 Thread Joshua Wiley
Hi Rookie, Sure, just use the dimnames argument. You pass it a list where the first element contains the row names and the second element contains the column names. Supposing you only want to name one dimension, just use NULL for the other (see ?matrix for full details). Using your data: x <-

Re: [R] column names only

2010-08-17 Thread Joshua Wiley
Hi, Here are two options. Depending whether the data is already read in or being created, one or the other may be more useful to you ### x1 <- matrix(1:4, ncol = 2) colnames(x1) <- c("First", "Second") #OR x2 <- matrix(1:4, ncol = 2, dimnames = list(NULL, c("First", "Second"))) x1 x2 ###

Re: [R] Matrix

2010-08-17 Thread Jorge Ivan Velez
Try this: x[, -1] HTH, Jorge On Tue, Aug 17, 2010 at 7:05 PM, Rookie wrote: > How do I completely remove the first column? > > (x <- matrix(c(1, 44, 124, 80, 254, 70, 190, 0, 2, 35, 110, 70, 240, 73, > 216, 0, 3, 41, 114, 80, 279, 68, 178, 0, 4, 31, 100, 80, 284, 68, 149, 0, 5, > 61, 190, 110

Re: [R] Combining values from a data.frame row with matrix rownames.

2010-08-17 Thread Joshua Wiley
Hi, I believe you are looking for ?unlist. Here is something that does what I think you want with data that is my best guess at what yours is like (if the data in seed_panel is stored as factor, you will probably need to convert it first somehow). > seed_panel <- data.frame(V2 = "507D22", V3 = "

Re: [R] Plot in cartesian plane

2010-08-17 Thread Pablo Cerdeira
Thanks! That was exactly what I was looking for. best regards *pablo de camargo cerdeira* pablo.cerde...@gmail.com | pa...@fgv.br Phone: +55-(21)-3799-6065 [image: Facebook] [image: LinkedIn][image: Google]

Re: [R] ROCR predictions

2010-08-17 Thread Claudia Beleites
Dear Assa, you need to call prediction with continuous predictions and a _binary_ true class label. You are the only one who can tell whether the p-values are actually predictions and what the class labels are. For the list readers p is just the name of whatever variable, and you didn't eve

[R] Digest, Vol90, Issue18 does not display properly

2010-08-17 Thread Jianyun Wu
Dear R team, I received Digest, Vol90, Issue18 today. However there are bunchs of threads not displaying properly. Could you please check it out?? Thanks and Regards Fred *After Message 15, :* Date/Time: 2010-08-16 14:14:57 +0300 OS Version: 10.6.4 (Build 10F569) Architecture:i

Re: [R] ask for help about netcdf

2010-08-17 Thread Prof Brian Ripley
Please learn that capitalization is important both in R (sic) and in effective communication. There are CRAN packages RNetCDF, ncdf and ncdf4 on CRAN to read/write NetCDF (sic) format files from R. On Wed, 18 Aug 2010, mat chueng wrote: hi,r project I am a new user who has some questions ab

<    1   2