Re: [R] Accessing graphs via url

2011-09-09 Thread David Winsemius
On Sep 10, 2011, at 1:44 AM, veepsirtt wrote: Hi I want to bring the graph from the site www.avasaram.com for the symbol GOOG here is the link http://www.avasaram.com/historyAction!addPatterns.action?model.ticker=GOOG&model.slectedPatternsIds=55 Learn to search: http://search.r-project.org/

[R] Accessing graphs via url

2011-09-09 Thread veepsirtt
Hi I want to bring the graph from the site www.avasaram.com for the symbol GOOG here is the link http://www.avasaram.com/historyAction!addPatterns.action?model.ticker=GOOG&model.slectedPatternsIds=55 How to get the graph in R?. With regards veepsirtt -- View this message in context: http://r.

Re: [R] Editing the variables attributes section in the netCDF header of netCDF files created using the package ncdf.

2011-09-09 Thread RMaidment
Hi Dave, Many thanks for you prompt and useful reply. It worked a treat! Another question which you might be able to answer is, is it possible to set the order of the variables attributes in which they appear? For example, I would like to set the order of Example 2 to Example 1: Example 1: dou

Re: [R] Looping through multiple datasets already in memory

2011-09-09 Thread MatAra
Thanks for the valuable comments Greg and Patrick! Oddly enough, I am doing something very close to "Portfolio analysis with random selection"... Justin, thanks for recommending google - fantastic stuff. Cheers, Mateo -- View this message in context: http://r.789695.n4.nabble.com/Looping-throug

Re: [R] Wilcox test

2011-09-09 Thread Chintanu
Hi Jorge, Thank you. Regarding the "group" variable, I am not sure how I can make my two groups - such that there will be 1013 Wilcox p-values from 1013 rows. Each row has 2 groups where Wilcox test is to be conducted : Group A (samples 1-3), Group B (samples 4-6) of the dataframe. That is, in si

Re: [R] Looping through multiple datasets already in memory

2011-09-09 Thread William Dunlap
You can also use list syntax, env$name or env[["name"]], with environments to avoid the ugliness of get() and assign() and to ease your way over to at least using a dedicated environment (if not a list) for your related objects instead of filling the global environment to various collections of obj

Re: [R] Different results with arima in R 2.12.2 and R 2.11.1

2011-09-09 Thread Stephen Sefick
Those are not "very" different. I would suspect they are within computer rounding error. Only numbers of log2 can be represented exactly, could that be it? Did you compiled the two versions differently, or could something have changed between 2.11.1 to 2.12.2 - both of which are old versions

Re: [R] Using SVG in R

2011-09-09 Thread Fong Chun Chan
Unfortunately yes. The whole SVG format doesn't seem to work for some reason on the server... Fong On Fri, Sep 9, 2011 at 4:35 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > To be honest, I don't know much about SVG files so we might have to wait > for someone more knowledgeable

Re: [R] Using SVG in R

2011-09-09 Thread R. Michael Weylandt
To be honest, I don't know much about SVG files so we might have to wait for someone more knowledgeable to come along, but do you get the same problem using the regular svg() command? Michael On Fri, Sep 9, 2011 at 5:40 PM, Fong Chun Chan wrote: > For convenience on my end since the plot was gen

[R] isotone

2011-09-09 Thread annie Zhang
Hi All, I need some help with the package 'isotone'? I have a big matrix (long) and I want to apply 'lsSolver' possibly with 'activeSet' to each row of the matrix. The plan is to use function 'apply', I tried several ways, but didn't work. Not sure if the FUN is activeSet or lsSolver. If I use t

Re: [R] Question about plot.mona {cluster}

2011-09-09 Thread Dennis Murphy
Hi: Here are a couple of ways to do this. The barplot() attempt is pretty close to the original banner plot except that the color is transparent to the (white) background. The ggplot2 graph is similar, but the code may be less familiar if you don't use the package. In the latter, the variable name

Re: [R] Using SVG in R

2011-09-09 Thread Fong Chun Chan
For convenience on my end since the plot was generated on a server and having to actually grab the file would have required a ftp or scp. A screenshot would have gotten the point across as I just wanted to show what it the problem looks like. If necessary, I can send the actual svg if that helps

Re: [R] Using SVG in R

2011-09-09 Thread R. Michael Weylandt
Perhaps the problem could be solved by playing with the pointsize argument to CairoSVG or the various plotting parameters of hist(). More generally, this code: R> library(CairoSVG) R> CairoSVG() R> hist(rpois(500,3)) R> dev.off() produced an entirely acceptable SVG image on my computer so I can'

[R] Using SVG in R

2011-09-09 Thread Fong Chun Chan
Hi, I've been trying to use SVG in R using the function svg, but all my my graphics end up with the text being very small to be point you can't even see them. I've attached a screenshot of what the output for a histogram looks like. Here is my code: CairoSVG('file/location') hist() dev.off(

[R] Different results with arima in R 2.12.2 and R 2.11.1

2011-09-09 Thread Luis Felipe Parra
Hello , I have estimated the following model, a sarima: p=9 d=1 q=2 P=0 D=1 Q=1 S=12 In R 2.12.2 Call: arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), optim.control = list(reltol = tol)) Coefficients: ar1 ar2 ar3 ar4 ar5 ar

Re: [R] Looping through multiple datasets already in memory

2011-09-09 Thread Greg Snow
The best approach is to put all those datasets into a list, then you can loop through the elements of the list, or use lapply or sapply on the list. If you insist on keeping them outside of a list, or need a loop to put them into the list, then look at the 'get' function. -Original Message-

[R] GLM Question

2011-09-09 Thread Jim Silverton
The minimum achievable level of significance is defined asthe minimum of Prob(Y=y) over all y's. If I have GLM with a treatment and replicate and I would like to find out how to compute the minimum achievable level of significance for that GLM in R For example, how do I do this for the following d

[R] Question about plot.mona {cluster}

2011-09-09 Thread trekvana
Hello all, I what to print the banner plot that is output from the mona method in the cluster package but the problem is I dont want to print all that red ink. Here is an example: data(animals) ma <- mona(animals) ma ## Plot similar to Figure 10 in Struyf et al (1996) plot(ma) I can change the ba

[R] Looping through multiple datasets already in memory

2011-09-09 Thread MatAra
Gents, I have the following loop: for (i in (seq(along=Draw.1[,1]))) {print(i)} # from 1 - 5 (counter) for (i in (seq(along=Draw.1[,1]))) {print(Draw[i,4])} # from the 1 - column (passes parameter per column) Now: I have multiple Draws [Draw.1 - Draw.100] in memory with different "orders" Quest

Re: [R] function censReg in panel data setting

2011-09-09 Thread Igors
Dear Arne, Thank you for your answer. However it doesn't solve my problem fully. The problem is that I have much bigger data set than I sent to you (it was only a small part : 874 obs.). My full data set is 546718 obs. If I try to use censReg on full data set, then it still gives me the same a

Re: [R] Reliability metric

2011-09-09 Thread William Dunlap
I may be wrong, but I thought the original poster was trying to make a matrix ('metric' sp.) of values, R, so that R[i,j] == f(t[i], h[i]) for all i and j where f <- function(t, h)exp(-(t/eta*(1-h))^(beta*(1-h)) outer() would do that: R <- outer(t, h, function(t, h)exp(-(t/eta*(1-h))^(beta

Re: [R] Reliability metric

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 3:14 PM, Halabi, Anan wrote: Hi, Below is the code I write, I am trying to create a metric of h and t while the values is out of function R. First I have message warning It is only a warning. Second, the metric is not created What "not created" means has already bee

Re: [R] Reliability metric

2011-09-09 Thread R. Michael Weylandt
Well, I would point out to you that you only have 9 values of h which certainly is a problem in calculating 10 colmans(?) -- more generally, I'd suggest you learn more about the difference between vectorized operations and operations on vectors: things like `%*%` and outer() will help you greatly.

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Michael Friendly
Thanks, David & Jean assign(), as you suggested works to create the named objects in the global environment. In my application, I also want to : (a) save each object to a similarly-named .RData file with that object (b) create a corresponding .Rd documentation file. (b) works fine in my loop

Re: [R] Reliability metric

2011-09-09 Thread R. Michael Weylandt
Your code works fine -- the warning message is just a heads up that the object z/eta (which has length 111) does not quite match up with 1-h which has length 10: usually this is a sign that the user defined something improperly so R gives you a nice warning, but it doesn't halt the calculation. As

[R] Reliability metric

2011-09-09 Thread Halabi, Anan
Hi, Below is the code I write, I am trying to create a metric of h and t while the values is out of function R. First I have message warning Second, the metric is not created > h <- seq(0.1, 0.9, by=0.1) > t <- seq(0,11000, by=100) > z <- cbind(t) > eta=1 > beta=2 > R <- array (1:1100, dim=

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Dennis Murphy
Hi: Hmm, these files look familiar...Lahman database? :) I have the 2010 set, so here's how I got this to work on my system: files <- list.files(pattern = '*.csv') > files [1] "Allstar.csv" "AllstarFull.csv" [3] "Appearances.csv" "AwardsManagers.csv" [5] "AwardsPlayers.csv

Re: [R] Rgl and plotmath symbols (via sprites): a trial

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 12:19 PM, Marius Hofert wrote: Dear Duncan, attached my next trial. It seems to work :-) Unfortunately, not the printing to pdf. Not getting a high-quality pdf is certainly one of the major drawbacks. If anybody knows how to fix that, please let me know. Even when generating the

Re: [R] Manhattan Plot

2011-09-09 Thread Jorge I Velez
Hi Jillian, Take a look at http://www.oga-lab.net/RGM2/func.php?rd_id=gap:mhtplot. Best, Jorge * * On Fri, Sep 9, 2011 at 12:40 PM, Weinfeld, Jillian <> wrote: > To whom it may concern: > > My name is Jillian Weinfeld. I am currently and undergraduate student at > New York University and workin

Re: [R] simple t test for multiple colimns

2011-09-09 Thread Jean-Christophe BOUËTTÉ
The examples in ?t.test and ?formula will help you. Don't forget "An Introduction to R" too to import your data in a data frame first... 2011/9/9 Mihovil Pletikos : > hi > i am new to r and i would like to how could i do something like this in > spss: > > T-TEST GROUPS=who('1' '2') >  /MISSING=ANA

Re: [R] Comments inside a line? Not possible?

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 12:21 PM, Dimitri Liakhovitski wrote: Hello! In the guidelines I've read: "Comment your code. Entire commented lines should begin with # and one space. Short comments can be placed after code preceded by two spaces, #, and then one space. " Which guidelines are those? They seem

Re: [R] Manhattan Plot

2011-09-09 Thread R. Michael Weylandt
You need to supply some information about how you actually are plotting your data so we can figure out what you've tried. Example code (with some toy data) would be greatly appreciated. Michael Weylandt On Fri, Sep 9, 2011 at 11:40 AM, Weinfeld, Jillian < jillian.weinf...@mssm.edu> wrote: > To w

[R] simple t test for multiple colimns

2011-09-09 Thread Mihovil Pletikos
hi i am new to r and i would like to how could i do something like this in spss: T-TEST GROUPS=who('1' '2') /MISSING=ANALYSIS /VARIABLES= X3881686 X2672712 X2842570 X3526544 X2902531 X2402942 X3382216 X3771800 X2427469 X2392945 X2453006 X2562821 X3416651 X3552083 X3721851 X2477438 X2926969 X3026

Re: [R] suggestion for proportions

2011-09-09 Thread array chip
Thanks all again for the suggestions. I agree with Wolfgang that mcnemar.test() is what I am looking for. The accuracy is the proportion of correct diagnosis compared to a gold standard, and I am interested in which diagnosis test is better, not particular interested in assessing the agreement b

[R] Manhattan Plot

2011-09-09 Thread Weinfeld, Jillian
To whom it may concern: My name is Jillian Weinfeld. I am currently and undergraduate student at New York University and working at Mount Sinai School of Medicine doing research with epilepsy patients. At the moment I am creating a manhattan plot with my data set. After reading many forums and

Re: [R] reshape data from long to wide format

2011-09-09 Thread Dennis Murphy
Hi: There are two ways to go about this, depending on what you want. # 1: Jean's output format: # I'm using the reshape package here with cast(), # but it should work similarly with dcast() in reshape2: > cast(example, DATE ~ SENSOR, value = 'VALUE') DATE A B C D E F 1

Re: [R] conditional Latin hypercube sampling

2011-09-09 Thread Ben Bolker
Eric Tiger yahoo.com> writes: > > Hello, > > I got one question on the Latin hypercube sampling. > > suppose > there are three variables a, b, c, all of them follow the normal > distribution. the mean value and standard deviation for each are  a(32, > 2), b(35,5), c(37,3). I would like to u

Re: [R] split variable / create categories

2011-09-09 Thread David L Carlson
This will work as long as the number of values is evenly divisible by four and no two observations are identical. But if either of those assumptions is false, you cannot be certain to get the even split you are looking for x <- c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6, 1.1, 0.6) ceiling(rank(x)/(len

Re: [R] split variable / create categories

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 12:10 PM, Martin Batholdy wrote: Thanks for the suggestions! However all these functions don't produce exactly what I want (at least with my actual data). I need a split-algorithm that converts the values of my vectors into four factors. And the crucial part is, that I n

Re: [R] Global optimisation with inequality constraints

2011-09-09 Thread Ravi Varadhan
Hi, Take a look at the multiStart() function in the "BB" package. This allows you to specify random multiple starting values, which need not satisfy constraints. Then you need to specify the constraints using the `projectLinear' argument. Ravi. ---

Re: [R] Comments inside a line? Not possible?

2011-09-09 Thread Dimitri Liakhovitski
Thank you, David. The only reason why I would prefer the in-line commenting is that it would save space. Having to start a new line stretches the code downwards. Dimitri On Fri, Sep 9, 2011 at 12:36 PM, David Winsemius wrote: > > On Sep 9, 2011, at 12:21 PM, Dimitri Liakhovitski wrote: > >> Hello

Re: [R] Comments inside a line? Not possible?

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 12:21 PM, Dimitri Liakhovitski wrote: Hello! In the guidelines I've read: "Comment your code. Entire commented lines should begin with # and one space. Short comments can be placed after code preceded by two spaces, #, and then one space. " Just wondering if there is no

Re: [R] split variable / create categories

2011-09-09 Thread Jean-Christophe BOUËTTÉ
so what about : library(ggplot2) z <- breaks(x,equal=NULL,nbins=4) a <- cut(x,z,include.lowest = TRUE) it works for me ! JC 2011/9/9 Martin Batholdy : > Thanks for the suggestions! > > However all these functions don't produce exactly what I want > (at least with my actual data). > > > I need a sp

Re: [R] Rgl and plotmath symbols (via sprites): a trial

2011-09-09 Thread Marius Hofert
Dear Duncan, attached my next trial. It seems to work :-) Unfortunately, not the printing to pdf. Not getting a high-quality pdf is certainly one of the major drawbacks. If anybody knows how to fix that, please let me know. Even when generating the labels "by hand" (with grid), the code is less

[R] Comments inside a line? Not possible?

2011-09-09 Thread Dimitri Liakhovitski
Hello! In the guidelines I've read: "Comment your code. Entire commented lines should begin with # and one space. Short comments can be placed after code preceded by two spaces, #, and then one space. " Just wondering if there is no way to comment something out "in the middle" of a line? Example:

Re: [R] How does one start R within Emacs/ESS with root privileges?

2011-09-09 Thread Karl Brand
Thanks a lot for sharing your experience and suggestions. I see now the logic of making use of my user library which doesn't require root privs. Apparently linux is actually set up to work well - something i'm not used to from the other OS i've used till now. And for the rare times i do need

Re: [R] split variable / create categories

2011-09-09 Thread Martin Batholdy
Thanks for the suggestions! However all these functions don't produce exactly what I want (at least with my actual data). I need a split-algorithm that converts the values of my vectors into four factors. And the crucial part is, that I need exactly the same number of elements in each factor-l

[R] Adding groups to regression line panel function in Lattice

2011-09-09 Thread Bigelow, Seth
I wish to display a single-panel Lattice figure with grouped data and fitted regression lines. I don't seem to be able to get the individual regression lines to display, e.g.; d <- data.frame(q = rep(1:6, each=10), cc = rep(seq(10,100, 10),6)) # create data frame with gr

Re: [R] get mean from cdf

2011-09-09 Thread annie Zhang
Thanks all for your replies. Your responses are very helpful. But it is indeed not my homework! I didn't know these functions, and wanted to avoid the loop. Annie On Fri, Sep 9, 2011 at 1:38 AM, peter dalgaard wrote: > > On Sep 9, 2011, at 03:51 , Jeff Newmiller wrote: > > > The diff function w

Re: [R] Exception in NeweyWest - Pre-Whitening necessary?

2011-09-09 Thread Achim Zeileis
On Fri, 9 Sep 2011, Simon Zehnder wrote: Hi guyz, I have run my algorithm in R (see http://pastebin.com/q84Tujfg) and got the following error: This is not reproducible. There is only the script but no information about how it is called. Also, within your script you call NeweyWest(regressio

[R] Problems using quantile regression (rq) to model GLD random variables in R

2011-09-09 Thread James Shaw
Everyone: I am working on a simulation of the efficiencies of regression estimators when applied to model a specific form of highly skewed data. The outcome variable (y) is being simulated from a generalized lambda distribution (GLD) to reflect the characteristics (mean, variance, skewness, kurto

Re: [R] split variable / create categories

2011-09-09 Thread Jean-Christophe BOUËTTÉ
Hi there, library(lattice) equal.count(x,number=4,overlap=0) JC 2011/9/9 Martin Batholdy : > Hi, > > is there a function or an easy way to convert a variable with continuous > values into a categorial variable (with x levels)? > > here is what I mean: > > > I want to transform x: > > x <- c(3.2

Re: [R] split variable / create categories

2011-09-09 Thread Ben Tupper
Hi, On Sep 9, 2011, at 11:34 AM, Martin Batholdy wrote: > Hi, > > is there a function or an easy way to convert a variable with continuous > values into a categorial variable (with x levels)? > > here is what I mean: > > > I want to transform x: > > x <- c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6,

[R] split variable / create categories

2011-09-09 Thread Martin Batholdy
Hi, is there a function or an easy way to convert a variable with continuous values into a categorial variable (with x levels)? here is what I mean: I want to transform x: x <- c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6, 1.1, 0.6) into a 'categorial'-variable with four levels so that I get: [1]

Re: [R] Rgl and plotmath symbols (via sprites): a trial

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 11:10 AM, Marius Hofert wrote: Dear all, Below is some code where I try to get plotmath symbols in an rgl plot. Duncan Murdoch kindly suggested to use a "sprite" for this. As you can see, on can get it to work, but my knowledge about grid and rgl is too limited to perfectly solve t

[R] Exception in NeweyWest - Pre-Whitening necessary?

2011-09-09 Thread Simon Zehnder
Hi guyz, I have run my algorithm in R (see http://pastebin.com/q84Tujfg) and got the following error: Error in ar.ols(x, aic = aic, order.max = order.max, na.action = na.action, : 'order.max' must be < 'n.used' I am pretty sure, that the error comes from the NeweyWest function in line 45,

Re: [R] Very simple question about list components

2011-09-09 Thread Clemontina Alexander
Thank you all. And thanks for pointing out I have an lm object, not a list. @ Steve, I knew I wasn't crazy when I saw him type "ans$" in the prompt. I didn't see him hit though. So a special thanks to you for helping me validate my sanity! :-) Tina On Fri, Sep 9, 2011 at 11:08 AM, Steve Liano

Re: [R] The elegant way to test if a number is a whole number

2011-09-09 Thread William Dunlap
Which of these functions is best really depends on why you are interested in knowing whether a number is integral or not. Why are people interested in this? I can think of a few 1) I have a C routine with the prototype void func(int *n) and to call it with .C() I need to make sure t

Re: [R] Very simple question about list components

2011-09-09 Thread Steve Lianoglou
Hi Clemontina, On Fri, Sep 9, 2011 at 11:01 AM, Clemontina Alexander wrote: > I have a list 'ans' from the following code: > > tt <- rnorm(50) > rr <- rnorm(50) > ans <- lm(rr~tt) > > ans[1] is "$coefficients", ans[2] is "$residuals", ans[3] is > "$effects", ... and so on up to ans[12]. Is there

Re: [R] Very simple question about list components

2011-09-09 Thread Sarah Goslee
> names(ans) [1] "coefficients" "residuals" "effects" "rank" [5] "fitted.values" "assign""qr""df.residual" [9] "xlevels" "call" "terms" "model" And thank you for providing a simple reproducible example. Sarah On Fri, Sep 9, 2011 at 11:01

Re: [R] Very simple question about list components

2011-09-09 Thread Jorge I Velez
Try > names(ans) [1] "coefficients" "residuals" "effects" "rank" [5] "fitted.values" "assign""qr""df.residual" [9] "xlevels" "call" "terms" "model" HTH, Jorge * * On Fri, Sep 9, 2011 at 11:01 AM, Clemontina Alexander <> wrote: > I have a

Re: [R] Very simple question about list components

2011-09-09 Thread R. Michael Weylandt
Try names(ans) Hope this helps, Michael Weylandt On Fri, Sep 9, 2011 at 10:01 AM, Clemontina Alexander wrote: > I have a list 'ans' from the following code: > > tt <- rnorm(50) > rr <- rnorm(50) > ans <- lm(rr~tt) > > ans[1] is "$coefficients", ans[2] is "$residuals", ans[3] is > "$effects", ..

[R] Very simple question about list components

2011-09-09 Thread Clemontina Alexander
I have a list 'ans' from the following code: tt <- rnorm(50) rr <- rnorm(50) ans <- lm(rr~tt) ans[1] is "$coefficients", ans[2] is "$residuals", ans[3] is "$effects", ... and so on up to ans[12]. Is there an easy way to display just these names and not the data they contain? I thought I saw my ad

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Jean V Adams
Michael Friendly wrote on 09/09/2011 09:39:27 AM: > > I have a collection of .csv files in a directory, and want to read them > into R data.frames whose names > are the same as the file names, without the .csv extension > > e.g., from > > (files <- list.files(pattern="*.csv")) > [1] "Allstar

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 10:39 AM, Michael Friendly wrote: I have a collection of .csv files in a directory, and want to read them into R data.frames whose names are the same as the file names, without the .csv extension e.g., from > (files <- list.files(pattern="*.csv")) [1] "Allstar.csv"

Re: [R] Subset function

2011-09-09 Thread William Dunlap
I thought that the main advantage of subset() over [() is that you only mention the name of the data.frame once, in the first argument, not in the second: > x <- data.frame(xin=c(1, 8, 16, 1, 8, 16), xout=c(14, 5, 884, 14, 5, 884)) > subset(x, xin > 7, select = xout) # not x$xin > 7 xout

[R] Read a list of files into named R data.frames

2011-09-09 Thread Michael Friendly
I have a collection of .csv files in a directory, and want to read them into R data.frames whose names are the same as the file names, without the .csv extension e.g., from > (files <- list.files(pattern="*.csv")) [1] "Allstar.csv" "AllstarFull.csv" [3] "Appearances.csv" "A

Re: [R] How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 8:12 AM, omega1x wrote: It is known that function bkde2D (package "KernSmooth") returns a matrix of density estimates over the mesh induced by x1 and x2. In Details it is written that "... heights of the kernel, scaled by the bandwidths, at each datapoint are summed. This

[R] analyse fMRI statistical maps in a mixed procedure (within-subject and between-subject error term)

2011-09-09 Thread Diederick Stoffers
Hi all, I have a set of 3D statistical parametric maps derived from an fMRI experiment in which we have two levels of dependency. - All subjects were scanned twice. - All subject are dizygotic (non-identical) twins. For every single scan (and thus statical map) we have a behavioural measure, w

Re: [R] Subset function

2011-09-09 Thread stat.kk
Thank you very much :) stat.kk -- View this message in context: http://r.789695.n4.nabble.com/Subset-function-tp3801397p3801626.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

[R] conditional Latin hypercube sampling

2011-09-09 Thread Eric Tiger
Hello, I got one question on the Latin hypercube sampling. suppose there are three variables a, b, c, all of them follow the normal distribution. the mean value and standard deviation for each are  a(32, 2), b(35,5), c(37,3). I would like to use Latin hypercube sampling to random generate 100

Re: [R] Subset function

2011-09-09 Thread stat.kk
No :( I dont have a condition on variable but on row name. My data frame looks like (from your example): > x xin xout Peter1 14 Tom 8 5 Jane 16 884 Paul 114 Cathy 8 5

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Marius Hofert
Dear Duncan, thanks a lot. Is it possible to rotate the label drawn by mtext3d, say, by 90 degrees? [a "rot=90" did not help] Cheers, Marius On 2011-09-09, at 14:32 , Duncan Murdoch wrote: > On 09/09/2011 8:02 AM, Marius Hofert wrote: >> Dear Duncan, >> >> thanks for your quick response. >>

Re: [R] reshape data from long to wide format

2011-09-09 Thread Jean V Adams
maxbre wrote on 09/09/2011 06:28:15 AM: > > This is my reproducible example: > > example<-structure(list(SENSOR = structure(1:6, .Label = c("A", "B", "C", > "D", "E", "F"), class = "factor"), VALUE = c(270, 292.5, 0, 45, > 247.5, 315), DATE = structure(1:6, .Label = c(" 01/01/2010 1", > " 01/

Re: [R] Subset function

2011-09-09 Thread Jean V Adams
Rainer provided an example of subsetting by the value of a variable in the data frame. Below is an example of subsetting by the value of the row name of the data frame. df <- data.frame(var1=1:10, var2=letters[1:10], var3=sample(10), row.names=month.abb[1:10]) subset(df, subset = row.name

Re: [R] Subset function

2011-09-09 Thread Rainer Schuermann
Does that help: > x xin xout 1 1 14 2 85 3 16 884 4 1 14 5 85 6 16 884 > subset( x, x$xin > 7, select = xout )

Re: [R] function censReg in panel data setting

2011-09-09 Thread Arne Henningsen
On 8 September 2011 09:56, Igors wrote: > Does censReg expect from panel data to be balanced? No. censReg() can estimate models with unbalanced panel data. The estimation in the code that you sent me indeed does not work but if I remove the user-specified starting values (argument "start"), it wo

[R] How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?

2011-09-09 Thread omega1x
It is known that function bkde2D (package "KernSmooth") returns a matrix of density estimates over the mesh induced by x1 and x2. In Details it is written that "... heights of the kernel, scaled by the bandwidths, at each datapoint are summed. This sum, after a normalization, is the corresponding f

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 8:02 AM, Marius Hofert wrote: Dear Duncan, thanks for your quick response. Below is my second trial. I had to use mtext3d to place the label for the z-axis at the new axis where the ticks are drawn (if there's a simpler solution, please let me know). Was the usage of rgl.viewpoint

Re: [R] problems with function read.table

2011-09-09 Thread Petr PIKAL
Hi > Hello, > > in the meanwhile i found the problem for the #. The problem was, that # and > “none” are comments by default, so I turned comments of with comment.char=”” > as stated in the help. Hm. You are not telling the whole story. I made a sample excel sheet with blank values and #DIV/0!

[R] How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?

2011-09-09 Thread Юрий Посохов
It is known that function bkde2D (package "KernSmooth") returns a matrix of density estimates over the mesh induced by x1 and x2. In Details it is written that "... heights of the kernel, scaled by the bandwidths, at each datapoint are summed. This sum, after a normalization, is the corresponding f

[R] Survival Analysis for soccer scoring process

2011-09-09 Thread ryusuke
6.4.1 Estimation of fixed effects Heterogeneous team ability is a possible explanation for the result in Section 6.3. That result simply indicates that the more goals a team scores, the higher the probability that it will score more. However, teams that can score more goals also indicate teams with

[R] Subset function

2011-09-09 Thread stat.kk
Hi, can anyone help me how to use 'subset' function on my data frame? I have created data frame 'data' with a few variables and with row names. Now I would like to subset rows with concrete row names. Using data[] I know how to do it. But I dont know how to formulate the subset condition: subset(

[R] reshape data from long to wide format

2011-09-09 Thread maxbre
This is my reproducible example: example<-structure(list(SENSOR = structure(1:6, .Label = c("A", "B", "C", "D", "E", "F"), class = "factor"), VALUE = c(270, 292.5, 0, 45, 247.5, 315), DATE = structure(1:6, .Label = c(" 01/01/2010 1", " 01/01/2010 2", " 01/01/2010 3", " 01/01/2010 4", " 01/01/20

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Marius Hofert
Dear Duncan, thanks for your quick response. Below is my second trial. I had to use mtext3d to place the label for the z-axis at the new axis where the ticks are drawn (if there's a simpler solution, please let me know). Was the usage of rgl.viewpoint meant this way? It is nice to adjust the r

Re: [R] envfit vector labels with ordiplot3d

2011-09-09 Thread Jari Oksanen
Briony gmail.com> writes: > > Hi R experts, > > I'm looking for some help with plotting vectors from envfit in vegan, onto a > 3d plot using ordiplot3d. So far I have > > data.mds <- metaMDS(data, k=3,trace = FALSE) > vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=) > ordiplot

Re: [R] pie chart

2011-09-09 Thread Jim Lemon
On 09/09/2011 03:35 AM, Mohan L wrote: Hi All, I have txt file like : $ cat data.txt US 10 UK 12 Ind 4 Germany 14 France 8 rawdata<- read.table(file='data.txt',sep='\t' , header=FALSE) rawdata V1 V2 1 US 10 2 UK 12 3 Ind 4 4 Germany 14 5 France 8 I

Re: [R] NMDS plot and Adonis (PerMANOVA) of community composition with presence absence and relative intensity

2011-09-09 Thread Jari Oksanen
Markus Lindh gmail.com> writes: > > Hi! > > Thanks for providing great help in R-related statistics. Now, however I'm > stuck. I'm not a statistics person but I was recommended to use R to perform > a nmds plot and PerMANOVA of my dataset. > > Sample(treatment) in the columns and species (OTU)

Re: [R] Spider (Radar) Plot

2011-09-09 Thread Jim Lemon
On 09/09/2011 06:31 AM, XINLI LI wrote: Dear R Group: Based on the following data, how to do a great Spider (Radar) Plot? Any advice is greatly appreciated. HospID Rate Age Charlson NIHSS 1 0.2 49 3.5 0 2 0.1 48 1.8 12 3 0.4 56 2.1 5 4 0.3 77 0 7 5 0.2 67 6.5 3 6 0.1 62 4.8 4.6 7 0.1

Re: [R] get and save

2011-09-09 Thread Göran Broström
On Fri, Sep 9, 2011 at 12:09 PM, Duncan Murdoch wrote: > On 11-09-09 6:01 AM, Ivan Calandra wrote: > >> Hi! >> >> Why don't you just save tmp? >> save(tmp, file = paste(name, "rda", sep = ".")) >> >> I don't think it makes much difference, at least not with your example. >> Or does it? >> > > That

Re: [R] prcomp: results with reversed sign in output?

2011-09-09 Thread René Mayer
thanks for explaining Duncan and Ted, Indeed, I did compare my results from a textbook and noticed that I consitenly get flipped signs and biplots. regards René Zitat von ted.hard...@wlandres.net: The point is that a principal component vector is a solution, say V, of a matrix equation A%*%V

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Duncan Murdoch
On 11-09-09 6:18 AM, Marius Hofert wrote: Dear expeRts, I am a new user of rgl, below is my first trial to plot a simple function in 3d. I managed to put the axes in the right locations, but: (1) The xlab, ylab, and zlab arguments are ignored; how can I put in axes labels? Those are documente

Re: [R] General help - online statistics courses?

2011-09-09 Thread Michael Griffiths
Hi Kensuguro, I would try the Royal Statistical Society, based in London. They have a range of courses from relatively basic through to graduate level, all of which are based on distance learning. However, what they also have now are modularised programmes, which might be ideal for you, as you are

[R] NMDS plot and Adonis (PerMANOVA) of community composition with presence absence and relative intensity

2011-09-09 Thread Markus Lindh
Hi! Thanks for providing great help in R-related statistics. Now, however I'm stuck. I'm not a statistics person but I was recommended to use R to perform a nmds plot and PerMANOVA of my dataset. Sample(treatment) in the columns and species (OTU) in the rows. I have 4 treatments (Ambient Temperat

[R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Marius Hofert
Dear expeRts, I am a new user of rgl, below is my first trial to plot a simple function in 3d. I managed to put the axes in the right locations, but: (1) The xlab, ylab, and zlab arguments are ignored; how can I put in axes labels? (2) Since I removed the axes in persp3d() the viewport is too s

Re: [R] get and save

2011-09-09 Thread Duncan Murdoch
On 11-09-09 6:01 AM, Ivan Calandra wrote: Hi! Why don't you just save tmp? save(tmp, file = paste(name, "rda", sep = ".")) I don't think it makes much difference, at least not with your example. Or does it? That saves it with the name "tmp", not "d2" as Göran wanted. Duncan Murdoch Ivan

Re: [R] get and save

2011-09-09 Thread Duncan Murdoch
On 11-09-09 5:55 AM, Göran Broström wrote: I have a data frame 'tmp' and a vector 'name' containing 'd2'. I want to save 'tmp' under the name hidden in 'name', and the file must have the same name, plus the extension '.rda'. So I try tmp x y 1 1 3 2 2 4 name [1] "d2" assign(name, tmp) sum

Re: [R] prcomp: results with reversed sign in output?

2011-09-09 Thread Ted Harding
The point is that a principal component vector is a solution, say V, of a matrix equation A%*%V = L*V where A is the matrix and L is a scalar.. Since this equation can be written A%*%(-V) = L*(-V), the result is indeterminate with respect to its sign. If V is a solution, so is (-V), and vice versa

Re: [R] get and save

2011-09-09 Thread Ivan Calandra
Hi! Why don't you just save tmp? save(tmp, file = paste(name, "rda", sep = ".")) I don't think it makes much difference, at least not with your example. Or does it? Ivan Le 9/9/2011 11:55, Göran Broström a écrit : I have a data frame 'tmp' and a vector 'name' containing 'd2'. I want to sav

Re: [R] Factors? I think?

2011-09-09 Thread peter dalgaard
On Sep 9, 2011, at 09:13 , Petr PIKAL wrote: > Hi > > Isn't it something for merge is designed? Sort of. (You'd need to think carefully about what happens with non-matched codes.) Wouldn't this do the trick as well? in <- as.character(DeptCodes$DeptCodes) out <- as.character(DeptCodes$DeptNa

  1   2   >