[R] How would you calculate this type of p-value using R?

2011-08-17 Thread RQuestion
Let's say you want to compare one observation with a sample, how would you use R to get a p-value for that single observation itself? To clarify what I'm asking: We know you use a one-sample t test to compare an actual sample to a hypothetical value, and a Wilcoxon test if it's not normally

Re: [R] how to get the result in short cut manner?

2011-08-17 Thread Lao Meng
Yes, you remind me of this! Thanks! 2011/8/16 Eik Vettorazzi e.vettora...@uke.uni-hamburg.de Hi Lao, you tried to reinvent the wheel. Have a look at ?tapply tapply(sleep$extra,sleep$group,mean) Cheers Am 16.08.2011 09:41, schrieb Lao Meng: Hi all: My data:data(sleep) If I wanna

Re: [R] a question about lm on t-test.

2011-08-17 Thread Lao Meng
Thanks Eik. As to your words:The intercept in lm is tested against 0 (one sample t-test) So, I perform the following test: t.test(extra[group==1],mu=0) Since goup1 is regarded as reference,I do the 1-sample ttest based on group1's mean vs 0. But the result: t value= 1.3257 p-value = 0.2176 And

Re: [R] generalized inverse using matinv (Design)

2011-08-17 Thread Frank Paetzold
thank you all. i have deliberately chosen matinv (although obviously an outdated version) because it uses the sweep operator. i know of other methods to calculate generalized inverses. however, it is also true that the sweep operator is capable of computing g2 generalized inverses. The ginv

Re: [R] Constructing an additional key inside of a lattice panel

2011-08-17 Thread Fredrik Karlsson
Dear list, following up on my own post, I have now started trying constructing a legend argument to xyplot that would work, based on the examples in Sarkar's book. I'm now at a state where I have a legend that does not throw an error, but no legend is displayed:

Re: [R] a question about lm on t-test.

2011-08-17 Thread Eik Vettorazzi
Hi Lao, thats not the same test. The concept of linear regression applies here (and you might take any introductory at your hand to refresh that concept). The intercept is estimated from the whole sample not just group==1, dfs are 20-2, not sum(group==1)-1! best regards Am 17.08.2011 09:57,

Re: [R] PBSmapping, where is Ireland?!

2011-08-17 Thread Rubén Roa
Dear Ewan, I faced this problem and solved it by contacting the package authors, John Schnute and Rowan Haigh, rowan.ha...@dfo-mpo.gc.ca. Here is a function that solves the problem by displacing the Greenwich meridian to longitude 348 leaving Ireland to the right. This longitude does not span

[R] A question about using getSrcDirectory() with R/Rscript

2011-08-17 Thread Cormac Long
Good morning R-help, I have an idiot question: I would like to use getSrcDirectory() and friends to allow me to identify where an R file has been called from when invoked using Rscript. If I understand the documentation correctly, the following example should work: In file test.R:

[R] Wilcox test

2011-08-17 Thread bdeepthi
Hello, I have used Wilcox test to find the p-value for hgua95 spiken data. It did not give the required result, and instead gave me warnings like the values are duplicated. Kindly suggest me how to overcome this problem as I am new to R. Thank you Deepthi BM

[R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Marius Hofert
Dear all, First, let's create some data to play around: set.seed(1) (df - data.frame(Group=rep(c(Group1,Group2,Group3), each=10), Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),]) ## Now we need the empirical distribution function: edf - function(x)

Re: [R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Nick Sabbe
You might want to look at package plyr and use ddply. HTH, Nick Sabbe -- ping: nick.sa...@ugent.be link: http://biomath.ugent.be wink: A1.056, Coupure Links 653, 9000 Gent ring: 09/264.59.36 -- Do Not Disapprove -Original Message- From: r-help-boun...@r-project.org

Re: [R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Paul Hiemstra
On 08/17/2011 11:24 AM, Nick Sabbe wrote: You might want to look at package plyr and use ddply. The following example does what you want using ddply: library(plyr) edfPerGroup = ddply(df, .(Group), summarise, edf = edf(Value), Value = Value) edfPerGroup Group edf Value 1 Group1 0.5

Re: [R] how to get the result in short cut manner?

2011-08-17 Thread Paul Hiemstra
On 08/16/2011 07:56 AM, Eik Vettorazzi wrote: Hi Lao, you tried to reinvent the wheel. Have a look at ?tapply tapply(sleep$extra,sleep$group,mean) or take a look at the plyr package: library(plyr) data(sleep) ddply(sleep, .(group), summarise, m = mean(extra)) cheers, Paul Cheers Am

Re: [R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Hadley Wickham
The following example does what you want using ddply: library(plyr) edfPerGroup = ddply(df, .(Group), summarise, edf = edf(Value), Value = Value) Or slightly more succinctly: ddply(df, .(Group), mutate, edf = edf(Value)) Hadley -- Assistant Professor / Dobelman Family Junior Chair

Re: [R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Marius Hofert
Dear all, thanks a lot for the quick help. Below is what I built with the hint of Nick. Cheers, Marius library(plyr) set.seed(1) (df - data.frame(Group=rep(c(Group1,Group2,Group3), each=10), Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),]) edf -

[R] packfor

2011-08-17 Thread COCCIA , CRISTINA
Good morning all, I'm trying to find the package packfor to install on my library in R, but I'm not available to find it online, so I would ask to you if you please let e know how I could find it and if I need a special R version to do it. Thanks a lot Regards Cristina

[R] Help with calc_sde

2011-08-17 Thread Sidhu Sabeena (ROYAL SURREY COUNTY HOSPITAL NHS FOUNDATION TRUST)
I cannot seem to get this to work? I have weighted data points that I want to fit an sd-ellipse to, but the ellipse is not right? I have attached a .tiff of what I get. I'm wondering if it's not looking at my actual data, but taking the data from the example? I ask this because I don't know

[R] Obtaining variable's names from a list of variables

2011-08-17 Thread Monsieur Do
Say I have a list of variables,  listVar - list(age,sex) I am looking for a way to either 1- create a vector c(age,sex) from it, or 2- get the names one by one in a for loop such as these     a)  for (i in 1:length(listVar)) rownames(result)[i] - ???     b)  for(i in listVar) print

[R] multinomRob - error message

2011-08-17 Thread Danielle Martin
Hi, I would like to use the multinomRob function to test election results. However, depending on which independent variables I include and how many categories I have in the dependent variable, the model cannot be estimated. My data look like this (there are 68 observations):

[R] interpreting interactions in a model

2011-08-17 Thread gaiarrido
Hi, I´ve got this model model-glm(prevalence~agesex+agesex:month,binomial) and the output of anova is like that anova(model,test=Chisq) Df Deviance Resid. Df Resid. Dev P(|Chi|) NULL524 206.97 agesex 2

[R] format, zero.print and NA

2011-08-17 Thread rexi
Hallo, I need to print a matrix where zeros as well as NA occuring. The NA must be keept and the zeros have to be converted to .. I used format and zero.print, but as soon as the matrix contains NA format gives an error message. Taking out the zero.print option or the NA's results in no problems.

[R] How to calculate residual mean deviance in rpart

2011-08-17 Thread Narayan Sharma
Hi, I am doing a regression tree using the package 'rpart' but could not able to calculate the residual mean deviance. Please help. Narayan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] R-help Digest, Vol 102, Issue 18

2011-08-17 Thread fraenzi . korner
Wir sind bis am 20. August in den Ferien und werden keine e-mails beantworten. Bei dringenden Fällen melden Sie sich bei Stefanie von Felten steffi.vonfel...@oikostat.ch We are on vacation until 20. August. In urgent cases, please contact Stefanie von Felten steffi.vonfel...@oikostat.ch

Re: [R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Paul Hiemstra
On 08/17/2011 11:51 AM, Marius Hofert wrote: Dear all, thanks a lot for the quick help. Below is what I built with the hint of Nick. Cheers, Marius library(plyr) set.seed(1) (df - data.frame(Group=rep(c(Group1,Group2,Group3), each=10), Value=c(rexp(10, 1),

Re: [R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Dimitris Rizopoulos
Have a look at function ave(), e.g., set.seed(1) (df - data.frame(Group=rep(c(Group1,Group2,Group3), each=10), Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),]) edf - function(x) ecdf(x)(x) df$edf - with(df, ave(Value, Group, FUN = edf)) df I hope it helps. Best,

Re: [R] packfor

2011-08-17 Thread Ista Zahn
A google search for packfor r package will do it. Best, Ista On Wed, Aug 17, 2011 at 3:49 AM, COCCIA , CRISTINA coc...@ebd.csic.es wrote: Good morning all, I'm trying to find the package packfor to install on my library in R, but I'm not available to find it online, so I would ask to you

Re: [R] packfor

2011-08-17 Thread Raphael Saldanha
Here is: http://r-forge.r-project.org/R/?group_id=195 On Wed, Aug 17, 2011 at 9:08 AM, Ista Zahn iz...@psych.rochester.eduwrote: A google search for packfor r package will do it. Best, Ista On Wed, Aug 17, 2011 at 3:49 AM, COCCIA , CRISTINA coc...@ebd.csic.es wrote: Good morning

Re: [R] packfor

2011-08-17 Thread Gavin Simpson
On Wed, 2011-08-17 at 09:49 +0200, COCCIA , CRISTINA wrote: Good morning all, I'm trying to find the package packfor to install on my library in R, but I'm not available to find it online, so I would ask to you if you please let e know how I could find it and if I need a special R

Re: [R] Symbol Font Baseline, Cairo, Card Symbols

2011-08-17 Thread Gavin Simpson
On Tue, 2011-08-16 at 17:46 -0700, ivo welch wrote: I think I found a bug in the Cairo library, plus weird behavior in both the Cairo and the normal pdf device. The baseline of the spades symbol seems to be off. This is easier to show than it is to explain. The problem does not appear in

Re: [R] Obtaining variable's names from a list of variables

2011-08-17 Thread Eik Vettorazzi
Hi, there is no direct way, since listVar - list(age,sex) creates a unnamed list, as can be seen by names(listVar) #or str(listVar) You can do sth like listVar - list(age=age,sex=sex) # or listVar2 - list(age,sex) names(listVar2)-c(age,sex) and afterwards access them using names(). Or you write

[R] Interpreting parameters of sigmoid fct

2011-08-17 Thread Anna Lee
Dear list, I'm trying to fit a chapman-richards equation to my data, only I cannot interpret the parameters a, b and d. I know that the parameter b denotes the asymptote, but for the others I couldn't figure out. But I do need to know this in order to set my starting values. Here's the model:

Re: [R] Obtaining variable's names from a list of variables

2011-08-17 Thread Marc Schwartz
On Aug 17, 2011, at 1:46 AM, Monsieur Do wrote: Say I have a list of variables, listVar - list(age,sex) I am looking for a way to either 1- create a vector c(age,sex) from it, or 2- get the names one by one in a for loop such as these a) for (i in 1:length(listVar))

Re: [R] Constructing an additional key inside of a lattice panel

2011-08-17 Thread Deepayan Sarkar
On Tue, Aug 16, 2011 at 4:35 PM, Fredrik Karlsson dargo...@gmail.com wrote: Hi, I would like to add an additional key inside of a panel based on a factor that is not the groups argument. I've tried using the panel.key function in latticeExtras, but I cannot get the line types the way I want

[R] question regarding gregexpr and read.table

2011-08-17 Thread Jack Luo
Hi, I have a silly question regarding the usage of two commands: read.table and gregexpr: For read.table, if I read a matrix and set header = T, I found that all the dash (-) becomes dots (.) A = read.table(Matrix.txt, sep = \t, header = F) A[1,1] # A-B-C-D. A = read.table(Matrix.txt, sep =

Re: [R] extract variables from model formula

2011-08-17 Thread Eik Vettorazzi
Hi Josh, I think, m - lm(mpg ~ factor(cyl)+I(mpg^2), data = mtcars) nd-get_all_vars(m,data=mtcars) is what you are after. cheers. Am 17.08.2011 04:27, schrieb Joshua Wiley: Hi All, I am writing a function to predict values based on a model. It works fine as long as the formula just uses

Re: [R] question regarding gregexpr and read.table

2011-08-17 Thread Eik Vettorazzi
Hi Jack, yes there is. see ?read.table for option check.names and to the 2nd task . is a special character in regular expressions, so mask it or don't use regular expressions: gregexpr([.],A.B.C.D) #or gregexpr(.,A.B.C.D,fixed=T) cheers. Am 17.08.2011 15:03, schrieb Jack Luo: Hi, I have a

[R] too many var in lm

2011-08-17 Thread carol white
Hello, It might be an easy question but if you have many variables to fit in the lm function, how do you take all without specifying var1+var2+...+var2100 in the terms parameter in response ~ terms? Cheers, Carol __ R-help@r-project.org mailing list

Re: [R] too many var in lm

2011-08-17 Thread R. Michael Weylandt
The most elegant solution is going to depend on where you data comes from, but one way to do it if you have a matrix of data: D = cbind(rcauchy(100), matrix(runif(100*50),ncol=50)) # Some nonsense data lm(D[,1] ~ D[,-1]) If you let us know how your data is set up, a more specific response can be

Re: [R] question regarding gregexpr and read.table

2011-08-17 Thread Raphael Saldanha
Hi! You can try import the file with header = F, and after inform that the first row is a header. On this post is some idea: http://stackoverflow.com/questions/2293131/reading-first-row-as-header-is-easy-what-gives-with-two-rows-being-the-header On Wed, Aug 17, 2011 at 10:03 AM, Jack Luo

Re: [R] getting names of dimnames of xtabs into xtable latex output

2011-08-17 Thread Juliet Hannah
Thanks for the suggestion, Duncan. However, I was trying to maintain the contingency table/cross-classification structure of the original table. My use of xtable on this table, maintains the structure I want, but the labels for the rownames and colum names is lost. On Tue, Aug 16, 2011 at

Re: [R] too many var in lm

2011-08-17 Thread Dimitris Rizopoulos
another approach is: Df - as.data.frame(cbind(rcauchy(100), matrix(runif(100*50), ncol = 50))) fit - lm(V1 ~ ., data = Df) fit I hope it helps. Best, Dimitris On 8/17/2011 3:28 PM, R. Michael Weylandt wrote: The most elegant solution is going to depend on where you data comes from, but one

Re: [R] too many var in lm

2011-08-17 Thread Eik Vettorazzi
Hi Carol, it might be another question if it is sensible to use 2100 regression parameters, but you can use . to regress one response against all other variables in a data frame as in: lm(formula = mpg ~ ., data = mtcars) and you can even exclude specific variables using - lm(formula = mpg ~ . -

Re: [R] too many var in lm

2011-08-17 Thread Doran, Harold
I'm not sure this is the most elegant way. See ?formula for the canonical way of doing this in R. However, I am hoping you're not fitting a model with more than 2,000 predictors, are you? If so, ummm, wow. -Original Message- From: r-help-boun...@r-project.org

[R] Lattice: problem with setting space between plot and legend

2011-08-17 Thread mike1989
Dear R Users, I am writing code to present my output data (I'm using Lattice Package). However, it's essential for me to control space between barchart and legend. I've read the package's specification, but unfortunately I haven't spot the information how to do this. Here's the code I've

Re: [R] exponential model with decreasing

2011-08-17 Thread Komine
Thank you bbolker for your help and advice about guide. Komine -- View this message in context: http://r.789695.n4.nabble.com/exponential-model-with-decreasing-tp3747572p3749933.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Lattice: problem with setting space between plot and legend

2011-08-17 Thread Raphael Saldanha
Hi, Maybe this post can help you: http://tolstoy.newcastle.edu.au/R/e2/help/06/10/2735.html On Wed, Aug 17, 2011 at 10:15 AM, mike1989 mihau@gmail.com wrote: Dear R Users, I am writing code to present my output data (I'm using Lattice Package). However, it's essential for me to control

Re: [R] Problems installing SJava

2011-08-17 Thread Uwe Ligges
Are you sure rJava is not fine for you? Uwe Ligges On 16.08.2011 17:16, Luis Felipe Parra wrote: Hello, I am trying to install SJava but I haven't been able to complete it successfully. I have tried to install it from bioconductor using the followin code and got the following output:

Re: [R] Problems installing SJava

2011-08-17 Thread Luis Felipe Parra
Uggs, as I understand rJava is for calling Java from within R and what I need is to call R within Java. Am I wrong? 2011/8/17 Uwe Ligges lig...@statistik.tu-dortmund.de Are you sure rJava is not fine for you? Uwe Ligges On 16.08.2011 17:16, Luis Felipe Parra wrote: Hello, I am trying to

[R] Chi square test on data frame

2011-08-17 Thread Bansal, Vikas
Is there anyone who can help me with chi square test on data frame.I am struggling from last 2 days.I will be very thankful to you. Dear all, I have been working on this problem from so many hours but did not find any solution. I have a data frame with 8 columns- V1 V2 V3

Re: [R] Lattice: problem with setting space between plot and legend

2011-08-17 Thread David Winsemius
On Aug 17, 2011, at 9:15 AM, mike1989 wrote: Dear R Users, I am writing code to present my output data (I'm using Lattice Package). However, it's essential for me to control space between barchart and legend. I've read the package's specification, but unfortunately I haven't spot the

Re: [R] too many var in lm

2011-08-17 Thread carol white
Thanks for your all replies.   Actually, I have more than this number of variables. I want to make a selection of variables with anova and I thought that I can apply anova to the object obtained by lm. The purpose is to select the genes discriminting control samples from disease.   Best, Carol

Re: [R] too many var in lm

2011-08-17 Thread David Winsemius
On Aug 17, 2011, at 10:39 AM, carol white wrote: Thanks for your all replies. Actually, I have more than this number of variables. I want to make a selection of variables with anova and I thought that I can apply anova to the object obtained by lm. The purpose is to select the genes

Re: [R] postscript( does not save the plot

2011-08-17 Thread Alaios
The problem is a bit weird. This does not work: ps.options=setEPS() postscript(file=exponcoverapprox.eps) boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c(1,3,5,8,10,13,1),outline=FALSE,ylim=c(0.01,50),log=y, xlab =

Re: [R] Symbol Font Baseline, Cairo, Card Symbols

2011-08-17 Thread ivo welch
hi gavin---I am not even sure that it is a cairo bug, much less do I know about the details where it sits. for all I know, it could be an Apple problem. the possible bug report was not only for the cairo package (what's the difference between a package and a library? in my user R code, I invoke

[R] How to use PC1 of PCA and dim1 of MCA as a predictor in logistic regression model for data reduction

2011-08-17 Thread khosoda
Hi all, I'm trying to do model reduction for logistic regression. I have 13 predictor (4 continuous variables and 9 binary variables). Using subject matter knowledge, I selected 4 important variables. Regarding the rest 9 variables, I tried to perform data reduction by principal component

Re: [R] Lattice: problem with setting space between plot and legend

2011-08-17 Thread Bert Gunter
(Note: Posted at the suggetsion of David Winsemius, to whom I already sent a private reply). Inline Below. On Wed, Aug 17, 2011 at 7:34 AM, David Winsemius dwinsem...@comcast.net wrote: On Aug 17, 2011, at 9:15 AM, mike1989 wrote: Dear R Users, I am writing code to present my output data

Re: [R] Lattice: problem with setting space between plot and legend

2011-08-17 Thread David Winsemius
On Aug 17, 2011, at 11:19 AM, Bert Gunter wrote: (Note: Posted at the suggetsion of David Winsemius, to whom I already sent a private reply). Inline Below. On Wed, Aug 17, 2011 at 7:34 AM, David Winsemius dwinsem...@comcast.net wrote: On Aug 17, 2011, at 9:15 AM, mike1989 wrote: Dear R

Re: [R] extract variables from model formula

2011-08-17 Thread Joshua Wiley
Hi Eik, Thanks, that got me on the right track. After looking at how get_all_vars() works, I am using: all.vars(as.formula(m)) which works great. Thanks again, Josh On Wed, Aug 17, 2011 at 6:14 AM, Eik Vettorazzi e.vettora...@uke.uni-hamburg.de wrote: Hi Josh, I think, m - lm(mpg ~

Re: [R] question regarding gregexpr and read.table

2011-08-17 Thread Jack Luo
Thank, Eik, it works! -Jack On Wed, Aug 17, 2011 at 9:19 AM, Eik Vettorazzi e.vettora...@uke.uni-hamburg.de wrote: Hi Jack, yes there is. see ?read.table for option check.names and to the 2nd task . is a special character in regular expressions, so mask it or don't use regular

Re: [R] postscript( does not save the plot

2011-08-17 Thread Marc Schwartz
Not sure what output you get in the first case. You don't need: ps.options=setEPS() just: setEPS() Using: set.seed(1) test - matrix(runif(500*500), 500) setEPS() postscript(file = exponcoverapprox.eps) boxplot(test[30, 1:500], test[90, 1:500], test[150, 1:500], test[210, 1:500],

Re: [R] Symbol Font Baseline, Cairo, Card Symbols

2011-08-17 Thread Gavin Simpson
On Wed, 2011-08-17 at 08:06 -0700, ivo welch wrote: hi gavin---I am not even sure that it is a cairo bug, much less do I know about the details where it sits. for all I know, it could be an Apple problem. the possible bug report was not only for the cairo package (what's the difference

Re: [R] Problems installing SJava

2011-08-17 Thread Uwe Ligges
On 17.08.2011 16:27, Luis Felipe Parra wrote: Uggs, as I understand rJava is for calling Java from within R and what I need is to call R within Java. Am I wrong? Partly: rJava contains JRI these days, see: http://www.rforge.net/rJava/ Uwe Ligges 2011/8/17 Uwe

[R] Getting vastly different results when running GLMs

2011-08-17 Thread Luke Duncan
Dear R gurus I am analysing data from a study of behaviour and shade utilization of chimpanzees. I am using GLMs in R (version 2.13.0) to test whether shade/sun utilization is predicted by behaviour observed. I am thus interested in whether an interaction of behaviour (as a predictor) and

[R] questions about metafor package

2011-08-17 Thread Emilie MAILLARD
Hello,   I would like to do a meta-analysis with the package « metafor ». Ideally I would like to use a mixed model because I’m interested to see the effect of some moderators. But the data set I managed to collect from literature presents two limits.   -         Firstly, for

Re: [R] Selecting section of matrix

2011-08-17 Thread mdvaan
That worked great, thanks! Now that I have created list h (see below), I would like to use the selections made in h to make new selections in list c (see below). List c needs to get the exact same shape as h, so that `8026`in 1997 (c$`1997`$`8026`) looks like this: $`1997`$`8026` B B

[R] Fatal Error after install of R 2.13.1

2011-08-17 Thread tcentofanti
I tried to install R 2.13.1 this morning on a Windows XP SP3 machine. I have the 2 previous versions of R running flawlessly. However when I try to open R from my Programs, I get an error and then R crashes. I've seen a few posts with this error but none of the fixes work (rename .RDATA, run as

[R] Using require() vs. library()

2011-08-17 Thread Nordlund, Dan (DSHS/RDA)
A recent post prompts me to ask this question. Is there any reason to prefer using library() over require()? I tend to use require() instead of library() to load packages, but I wonder if there are situations where it would be better to use library(). Enquiring minds would like to know,

Re: [R] trouble installing packages on OpenSuse 11.4

2011-08-17 Thread Dinesh
Thanks for the idea Rolf, it helped me isolate the cause. FWIW I still wanted to get the automatic dependencies check that install.packages() provides - an incredibly powerful incentive. I found the following workaround to be effective for me. repos = getOptions(repos) repos[CRAN] =

Re: [R] Using require() vs. library()

2011-08-17 Thread Ista Zahn
Hi Dan, Is there something you would like to know that is not covered by help(library) ? Best, Ista On Wed, Aug 17, 2011 at 12:40 PM, Nordlund, Dan (DSHS/RDA) nord...@dshs.wa.gov wrote: A recent post prompts me to ask this question.  Is there any reason to prefer using library() over

Re: [R] questions about metafor package

2011-08-17 Thread Viechtbauer Wolfgang (STAT)
Dear Emilie, Regarding your questions: 1) It's not the weighting that is the main issue when you do not have the SDs. The problem is that you need the SDs to calculate the sampling variances of the mean differences (I assume that this is your outcome measure for the meta-analysis). Those are

Re: [R] questions about metafor package

2011-08-17 Thread Jeremy Miles
. - Firstly, for each observation, I have means for a treatment and for a control, but I don’t always have corresponding standard deviations (52 of a total of 93 observations don’t have standard deviations). Nevertheless I have the sample sizes for all observations so I wonder if

[R] question regarding headers with space in the names

2011-08-17 Thread Jack Luo
Hi, After I read an xlsx file into the work space: A - read.xlsx(B.xls, header = T, check.names = F) There are several headers with the names like: colnames(A) [1:4] # [1] A 1B [3] C 2 D I can get the content of column 2 and column 4 easily by A$B

Re: [R] Using require() vs. library()

2011-08-17 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: istaz...@gmail.com [mailto:istaz...@gmail.com] On Behalf Of Ista Zahn Sent: Wednesday, August 17, 2011 10:12 AM To: Nordlund, Dan (DSHS/RDA) Cc: r-help@r-project.org Subject: Re: [R] Using require() vs. library() Hi Dan, Is there something you would like

Re: [R] question regarding headers with space in the names

2011-08-17 Thread Ista Zahn
Hi Jack, You need to quote non-syntactic names. A$`A 1` A$'A 1' A$A 1 should all work, with the first form being the recommended one. Best, Ista On Wed, Aug 17, 2011 at 1:45 PM, Jack Luo jluo.rh...@gmail.com wrote: Hi, After I read an xlsx file into the work space: A - read.xlsx(B.xls,

Re: [R] interpreting interactions in a model

2011-08-17 Thread Dennis Murphy
Hi: On Wed, Aug 17, 2011 at 1:56 AM, gaiarrido gaiarr...@usal.es wrote: Hi, I´ve got this model model-glm(prevalence~agesex+agesex:month,binomial) and the output of anova is like that anova(model,test=Chisq)                          Df Deviance Resid. Df Resid. Dev P(|Chi|) NULL          

Re: [R] Chi square test on data frame

2011-08-17 Thread R. Michael Weylandt
I think everything below is right, but it's all a little helter-skelter so take it with a grain of salt: First things first, make your data with dput() for the list. Y = structure(c(0, 35, 0, 0, 0, 0, 84, 84, 0, 48, 84, 0, 22, 0, 0, 0, 0, 0, 10, 0, 48, 0, 0, 48, 0, 22, 0, 0, 0, 0, 84, 84, 0, 48,

Re: [R] Using require() vs. library()

2011-08-17 Thread Uwe Ligges
Actually require() is a wrapper around library() with more error handling to be used inside other functions. Just type require(), you can read the few lines of code quickly. Uwe Ligges On 17.08.2011 19:57, Nordlund, Dan (DSHS/RDA) wrote: -Original Message- From: istaz...@gmail.com

Re: [R] Fatal Error after install of R 2.13.1

2011-08-17 Thread Uwe Ligges
On 17.08.2011 17:17, tcentofanti wrote: I tried to install R 2.13.1 this morning on a Windows XP SP3 machine. I have the 2 previous versions of R running flawlessly. However when I try to open R from my Programs, I get an error and then R crashes. I've seen a few posts with this error but none

Re: [R] Using require() vs. library()

2011-08-17 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Wednesday, August 17, 2011 11:14 AM To: Nordlund, Dan (DSHS/RDA) Cc: r-help@r-project.org Subject: Re: [R] Using require() vs. library() Actually require() is a wrapper around library() with more

[R] dotchart vs. dotplot ... groups

2011-08-17 Thread mkzodet
I'm trying to create a dotplot with some grouping. I've been able to create what I want using dotchart (basic graphics), but can't quite get it using dotplot (lattice). I prefer to use lattice (or ggplot2) because I think it's a bit easier to control some other aspects of the plot appearance.

Re: [R] How to apply a function to subsets of a data frame *and* obtain a data frame again?

2011-08-17 Thread Dennis Murphy
Hi: I would agree with Paul Hiemstra about using Hadley's code instead; see ?plyr:::mutate for details. It would also make sense to sort the data and edf by group - this does it in one line: arrange(ddply(df, .(Group), mutate, edf = edf(Value)), Group, edf) HTH, Dennis On Wed, Aug 17, 2011 at

[R] Case-by-case tolerance needed for successful integrate()

2011-08-17 Thread Delphine Pessoa
Hello, We are trying to use R to simulate a model based on some parameters 'a' and 'b'. This involves the following integration: model-function(s,x,a,b)(exp(-s*x*10^-5.5)*(s^(a-1)*(1-s)^(b-1))) g- function(x,a,b){ out-c() for (i in 1:length(x)){ out[i]-1-

Re: [R] Chi square test on data frame

2011-08-17 Thread Bansal, Vikas
Dear Michael, Thanks a lot for your reply and for your help.I was struggling so much but your suggestion showed me a path to the solution of my problem.I have tried your code on my data frame step wise and it looks fine to me.But when i tried chi square test-

[R] Obtain beta regression estimation for betareg and VGAM package

2011-08-17 Thread justin bem
Dear all, I'm trying to estimate beta regression with the betareg package and VGAM package With the betareg package (Cribari-Neto and Zeilis) I use this code betareg(formula, data) In my mind it possible with VGAM function vglm as vglm(formula,betaff, data) But betaff have two shapes

[R] Re : Obtain beta regression estimation for betareg and VGAM package

2011-08-17 Thread justin bem
I have found the solution betareg(formula, data) is equivalent to vglm(formula,betaff(zero=2),data) Sorry for the previous post.   Justin BEM BP 1917 Yaoundé Tél (237) 76043774 - Mail original - De : justin bem justin_...@yahoo.fr À : R Maillist r-h...@stat.math.ethz.ch Cc : Envoyé

[R] vglm regression with weibull distribution

2011-08-17 Thread justin bem
Dear all, I'm facing a problem in estimation of glm model with weibull distribution. I run this : eqn0-formula(fdh~cup1+cup2+cup3+cup4+fin1+vd1+cm2+cm4+milieu+cpro1+cpro2+cpro3a+cpro3b+schef+log(y)) regWeib0-vglm(eqn0,family=weibull,subset(br, fdh1)) I have en estimation but there is a message

[R] [statEt] Rmpi problem in Eclipse statEt

2011-08-17 Thread m.marcinmichal
Hi, I try use Rmpi package to my compute. In my work I'm using eclipse version 3.6.2 and statEt version 0.10.0 (launch Rterm or RJ). Actually I observed strange behavior, when I try loading Rmpi directly I don't have any problem i.e.: library(Rmpi) mpi.spawn.Rslaves() 8 slaves are spawned

Re: [R] [statEt] Rmpi problem in Eclipse statEt

2011-08-17 Thread m.marcinmichal
I try loading Rmpi directly I don't have any problem i.e. I loading Rmpi by R x64 2.12.2 (GUI) -- View this message in context: http://r.789695.n4.nabble.com/statEt-Rmpi-problem-in-Eclipse-statEt-tp3750738p3750743.html Sent from the R help mailing list archive at Nabble.com.

[R] How to rotate a contour?

2011-08-17 Thread kokavolchkov
Hello! I have a contour and I need *to rotate* it 180 degrees counterclockwise and 180 degrees around the x-axis. This is a code. I get all the values from the ncdf file: A = get.var.ncdf(nc, air, start=c(1,1,1,1), count=c(144,73,1,1)) contour(A) Thank you! -- View this message in context:

Re: [R] Obtaining variable's names from a list of variables

2011-08-17 Thread Monsieur Do
Thank you for your answers. Problem solved. Eik's cue to all.names(match.call())[-1] was particularly enlightning! Do   De : Eik Vettorazzi [mailto:e.vettora...@uke.uni-hamburg.de] Envoyé : 17 août 2011 08:46 À : Monsieur Do Cc : r-help@r-project.org Objet : Re: [R] Obtaining variable's

Re: [R] Labelling all variables at once (using Hmisc label)

2011-08-17 Thread Monsieur Do
I did read the help page before posting, but didn't find the direct way... My function here works fine. But just for learning purposes, I'd like to be able to avoid the loop... with.labels - function(x, labels=NULL, csvfile=NULL) { if(!is.null(csvfile)) labels - read.csv(csvfile, sep=\t,

[R] Convert week value to date

2011-08-17 Thread Folkes, Michael
Hello all, I'm hoping to convert a decimal value for week of the year back to a date object. Eg: strptime(paste(2010,1:52,sep= ),format=%Y %W) I expected (hoped?) this would give me the date for Monday of each week. Instead, it's giving me 52 values of today's date. Where am I erring? Thanks

Re: [R] Getting vastly different results when running GLMs

2011-08-17 Thread Mark Difford
On Aug 17, 2011; 5:43pm Luke Duncan wrote: Hi Luke, The differences you are seeing are almost certainly due to different contrast codings: Statistica probably uses sum-to-zero contrasts whereas R uses treatment (Dunnett) contrasts by default. You would be well advised to consult a local

[R] prcomp

2011-08-17 Thread Rosario Garcia Gil
Hello I am trying to run a PCA on the attached file, but I get this error message: pc-prcomp(data[,-(1:2)],scale=T)$x Error in svd(x, nu = 0) : infinite or missing values in 'x' Thanks in advance /R x y x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 1 25.49 45.62 125 156 165 130 179 152 82 165

Re: [R] Convert week value to date

2011-08-17 Thread David Winsemius
On Aug 17, 2011, at 4:52 PM, Folkes, Michael wrote: Hello all, I'm hoping to convert a decimal value for week of the year back to a date object. Eg: strptime(paste(2010,1:52,sep= ),format=%Y %W) Yeah, agree that seems as though it should have been successful. I cannot get any of my

[R] contrast package with interactions in gls model

2011-08-17 Thread Marylin Bejarano
Hi! I try to explain the efffect of (1) forest where i took samples's soils (* Lugar*: categorical variable with three levels), (2) nitrogen addition treatments (*Tra*: categorical variable with two levels) on total carbon concentration's soil samples (*C: *continue* *variable) during four

Re: [R] prcomp

2011-08-17 Thread David Winsemius
On Aug 17, 2011, at 5:19 PM, Rosario Garcia Gil wrote: Hello I am trying to run a PCA on the attached file, but I get this error message: pc-prcomp(data[,-(1:2)],scale=T)$x Error in svd(x, nu = 0) : infinite or missing values in 'x' What part of missing values in 'x' is unclear in that

Re: [R] contrast package with interactions in gls model

2011-08-17 Thread Frank Harrell
You did not follow the posting guide. You did not specify which packages you were using. It appears that you are mixing the rms package with some other functions such as gls. If you want to use rms, use the Gls function instead of gls, and type ?contrast.rms to see examples of the use of

Re: [R] Labelling all variables at once (using Hmisc label)

2011-08-17 Thread Frank Harrell
I'm puzzled. I provided a solution that did not require looping. Frank Monsieur Do wrote: I did read the help page before posting, but didn't find the direct way... My function here works fine. But just for learning purposes, I'd like to be able to avoid the loop... with.labels -

Re: [R] prcomp

2011-08-17 Thread David Winsemius
On Aug 17, 2011, at 5:47 PM, David Winsemius wrote: On Aug 17, 2011, at 5:19 PM, Rosario Garcia Gil wrote: Hello I am trying to run a PCA on the attached file, but I get this error message: pc-prcomp(data[,-(1:2)],scale=T)$x Error in svd(x, nu = 0) : infinite or missing values in 'x'

  1   2   >