[R] regression questions (lm, lmer)

2011-04-16 Thread Iasonas Lamprianou
Dear all,  I hope this is the right place to ask this question. I am reviewing a research where the analyst(s) are using a linear regression model. The dependent variable (DV) is a continuous measure. The independent variables (IVs) are a mixture of linear and categorical variables. The

Re: [R] Categorical bubble plot

2011-04-16 Thread Tal Galili
Hi Jurgens, In the following post I show how to use balloonplot from qplots to do more or less what you ask: http://www.r-statistics.com/2010/02/nutritional-supplements-efficacy-score-graphing-plots-of-current-studies-results-using-r/ p.s: the code has a slight modification to it, so to handle

Re: [R] Rsquared for anova

2011-04-16 Thread Peter Ehlers
On 2011-04-15 14:36, Dorien Herremans wrote: Hi, Thank you for your suggestion. I am stil quite new to the syntax of R. I tried in a few ways but all produced errors: You might find working through An Introduction to R enlightening. It's certain to be a more efficient method than a

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-16 Thread peter dalgaard
On Apr 16, 2011, at 04:21 , Nilaya Sharma wrote: genetic_evaluation - read.table(textConnection( sire dam adg 1 1 2.24 1 1 1.85 1 2 2.05 1 2 2.41 4 2 1.86 4 2 1.79 5 1 2.82 5 1 2.64 5 2 2.58 5 2 2.56), header = TRUE) # my R practice codes require (lme4)

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-16 Thread Dieter Menne
Nilaya Sharma wrote: I was trying to fit a mixed model in animal experiment but stuck at simple point. The following similar example is from SAS mixed model pp 212. genetic_evaluation - read.table(textConnection( sire dam adg 1 1 2.24 1 1 1.85 ... 5 2 2.58 5 2 2.56), header

Re: [R] A simple normal-curve question

2011-04-16 Thread Dieter Menne
helin_susam wrote: x - rnorm(100) y - rlnorm(100) model - lm(y~x) a - resid(model) How I show the all area under the normal curve? First, always try plot(model). It can never hurt. Too bad the plot you want is not among the six contenders (?plot.lm). To do it manually:

Re: [R] Rsquared for anova

2011-04-16 Thread Dieter Menne
dorien wrote: fit - lm((tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length, data=expdata)) Error: unexpected ',' in fit - lm((tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length, Peter's point is the important one: too many interactions, and even with + instead of * you

[R] Question abt power calculation in multistrata data using Hmisc or other package

2011-04-16 Thread Vickie S
Hi, I have two unequal patient groups belonging to different geographic locations, treated by different drug regimens and their survival data. N1=150 and N2=60 In each group of data there are three strata for one independent variable- treatment status (2=two drugs administered, 1=only one

Re: [R] spatstat regression troubles

2011-04-16 Thread Rolf Turner
On 16/04/11 15:50, Gregory Ryslik wrote: Hi Everyone, I am trying to figure out the spatstat package for the first time and am having some trouble. Unfortunately, I can't post my data set but I'll hopefully post enough details for some help. I want to model the intensity of a spatial point

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-16 Thread peter dalgaard
On Apr 16, 2011, at 09:52 , Dieter Menne wrote: Thanks for providing a self-contained example. The error message is really a bit confusing (anybody around who understands what lme thinks here?), It's not thinking at all, it's just evaluating a:b (so usual model formula interpretation is

Re: [R] How to make truncated y axis (cut mark) in R plot?

2011-04-16 Thread Peter Ehlers
On 2011-04-15 16:42, Bill Hyman wrote: Hi friends, Does anyone know how to make truncated y axis with cut mark (\\) in R plot? Many thanks! See axis.break() in the plotrix pkg. Peter Ehlers Bill __ R-help@r-project.org mailing list

[R] Help me create a hyper-structure

2011-04-16 Thread Alaios
Dear all I would like to have in R a big struct containing a smaller struct. I have tried something that I would like to share and ask your help make it work 1) I would like to have a small struct with the following three fields xorder (an integer ranging from 0 to 20) yorder (an integer

[R] Sweave, SweaveHooks and printing the label

2011-04-16 Thread David.Epstein
I would like to print the label of each code chunk, just before printing the code chunk itself. Is that possible using SweaveHooks, or by some other mechanism? Thanks David -- View this message in context:

[R] how to get the plot like this by R?

2011-04-16 Thread wangxipei
Dear R users, I see a graph (shown athttps://cid-c486ebef16722625.photos.live.com/self.aspx/%e6%88%91%e5%96%9c%e6%ac%a2%e7%9a%84%e8%8a%b1/untitled.bmp) in a published paper, which is very informative and clear. But I don't know what type the graph is. It looks like a sactter plot but

Re: [R] Launcher for Rattle?

2011-04-16 Thread Iurie Malai
Thank you! Your code worked! I tested all the combinations and this shows that, in addition to the 'rattle', in this launcher code the 'utils' package is required, otherwise 'rattle' do not launch. Without all other packages 'rattle' starts very well. But what will be better, the inclusion or not

Re: [R] patterned non-random jitter

2011-04-16 Thread Jim Lemon
On 04/16/2011 06:30 AM, Daryl Morris wrote: Hi, Is there a function somewhere that does a patterned jitter of data? I've googled and the problem is that I don't know what to google for. The setting is in grouped data. I have plots which overlay jittered points on a boxplot. I simply jitter the

Re: [R] how to get the plot like this by R?

2011-04-16 Thread wangxipei
I am sorry for the fault. The figure is posted athttp://www.mediafire.com/i/?08b9f4um43vxvw8 (hope this works!). Thank John for the website. Xipei Wang, Ph.D. student -- Xipei Wang, Ph.D. student Department of Pharmaceutics, School of Pharmaceutical Sciences, Peking University Health

Re: [R] how to get the plot like this by R?

2011-04-16 Thread John Kane
The link is working fine now. Have a look at http://www.r-statistics.com/2011/03/beeswarm-boxplot-and-plotting-it-with-r/ .  I think Jim Lemon's code does what you want.  --- On Sat, 4/16/11, wangxipei wangxi...@gmail.com wrote: From: wangxipei wangxi...@gmail.com Subject: Re:Re: [R] how

Re: [R] Conveting SAS Proc mixed to R code

2011-04-16 Thread Douglas Bates
On Fri, Apr 15, 2011 at 8:45 AM, Ben Bolker bbol...@gmail.com wrote: Kevin Wright kw.stat at gmail.com writes: I am trying to teach myself R and replicate some previous SAS analysis. Could someone please help me translate the following SAS code into R. Proc mixed method=ml Class Group

Re: [R] spatstat regression troubles

2011-04-16 Thread Gregory Ryslik
Hi Mr. Turner, You are correct that I am confused a bit by the RCode. Basically, I have 3772 observations of data and only about 500 of them correspond to where people exist. For the other observations, I just have the covariate values so I thought that this was appropriate. Thus, where

[R] Matching Problem: Want to match to data.frame with inexact matching identifier (one identifier has to be in the range of the other).

2011-04-16 Thread Christoph Jäckel
Hello R-Community, I have the following matching problem: I have two data.frames, one with an observation every month (per company ID), and one with an observation every quarter (per company ID; note that quarter means fiscal quarter; therefore 1Q = Jan, Feb, Mar is not necessarily correct and

Re: [R] Help me create a hyper-structure

2011-04-16 Thread Ben Bolker
Alaios alaios at yahoo.com writes: Dear all I would like to have in R a big struct containing a smaller struct. 1) I would like to have a small struct with the following three fields xorder (an integer ranging from 0 to 20) yorder (an integer ranging from 0 to 20) estimated (a 256*256

Re: [R] Help me create a hyper-structure

2011-04-16 Thread Alaios
Dear Ben, I would like to thank you for your answer. Unfortunately is not very clear how simplify works and what is the difference between TRUE and FALSE ( I am not at work right now to check the difference) Regards Alex --- On Sat, 4/16/11, Ben Bolker bbol...@gmail.com wrote: From: Ben

Re: [R] how to get the plot like this by R?

2011-04-16 Thread Dieter Menne
bellewong wrote: The figure is posted at http://www.mediafire.com/i/?08b9f4um43vxvw8 That type of plot that has descended on us like a beeswarm. Try the package with that name. Dieter -- View this message in context:

Re: [R] How to generate a correlation matrix with restrictions on its eigenvalues

2011-04-16 Thread Chee Chen
Hi, Ravi, Thank you, but I did not get it! I tried hard by specifying the vector of probabilities, but it always gives zeros and all integers as eigenvalues. The eigenvalues need to be not just integers and they should satisfy order requirement. Any more suggestions? Regards, -Chee From:

[R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Josh B
Dear listserv, Here is my latest formatting problem. I would like to rotate the x-axis labels by 45 degrees on a _barplot_. Apparently this is slightly different from the example given in the R FAQ, which is for rotating the x-axis labels on a scatterplot

Re: [R] Problem with R 2.13.0 Task Views (on Mac)

2011-04-16 Thread Achim Zeileis
On Fri, 15 Apr 2011, Uwe Ligges wrote: On 14.04.2011 18:14, rbali wrote: Same problem with Vista 1. Please quote the original message, mailing list readers are not able to follow otherwise! 2. Peter Dalgaard wrote that it is a bug in the ctv package, so everything is said already. And

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-16 Thread Nilaya Sharma
Hi Peter and R community; Thank you Peter for suggestion. I tried the following: genetic_evaluation-transform(genetic_evaluation, sire=factor(sire),dam=factor(dam)) require(lme4); mod - lmer(adg ~ 1 + (1|sire) + (1|dam:sire), data=genetic_evaluation) ranef (mod) provides random effects

Re: [R] how to get the plot like this by R?

2011-04-16 Thread John Kane
All that link is doing is taking me to a Windows Live log-in screen. An alternative posting site might be [url=http://www.mediafire.com/][b]Mediafire[/b][/url . --- On Sat, 4/16/11, wangxipei wangxi...@gmail.com wrote: From: wangxipei wangxi...@gmail.com Subject: [R] how to get the plot

[R] simple user input

2011-04-16 Thread cassiorx
I'd like to provide a simple user capability of choosing some parameters that I could grab to generate a graph. User would be selecting choices via radio buttons etc via a web browser. I work in a Windows environment. Does anyone have sample code? -- View this message in context:

[R] Problem using package 'cgdsr' behind http proxy

2011-04-16 Thread torbjoern . k
Dear R-users, -developers and -maintainers, The situation is the following. My colleagues and me need to use the CGDSR- package (http://www.cbioportal.org/cgx/cgds_r.jsp) on a Ubuntu 10.04 64bit workstation behind a HTTP proxy at campus. We are using R 2.12.2 (2011-02-25) retrieved via the

Re: [R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Sascha Vieweg
On 11-04-16 15:04, Josh B wrote: Dear listserv, Here is my latest formatting problem. I would like to rotate the x-axis labels by 45 degrees on a _barplot_. Apparently this is slightly different from the example given in the R FAQ, which is for rotating the x-axis labels on a scatterplot

[R] CairoPDF, Fonts, and Windows 7

2011-04-16 Thread Al Roark
Hi All: I have some basic questions about Cairo graphics engine. I'm trying to use the Cairo package to produce PDF output, mainly because I perceive it to be easy to use with a wide variety of fonts. But right now, I'm stuck trying to figure out what fonts are available to be used with Cairo,

Re: [R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Peter Ehlers
On 2011-04-16 09:36, Sascha Vieweg wrote: On 11-04-16 15:04, Josh B wrote: Dear listserv, Here is my latest formatting problem. I would like to rotate the x-axis labels by 45 degrees on a _barplot_. Apparently this is slightly different from the example given in the R FAQ, which is for

Re: [R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Marc Schwartz
On Apr 16, 2011, at 11:50 AM, Peter Ehlers wrote: On 2011-04-16 09:36, Sascha Vieweg wrote: On 11-04-16 15:04, Josh B wrote: Dear listserv, Here is my latest formatting problem. I would like to rotate the x-axis labels by 45 degrees on a _barplot_. Apparently this is slightly

[R] My added packages won't load in r.2.13.0

2011-04-16 Thread Tyler Rinker
Problem: I updated from r.2.12 to r.2.13 and when I use library(car) for example it says: library(car) Error in library(car) : there is no package called 'car' So I found that the packages I had before are located in: C:\Users\Documents\R\win-library\2.12 Now they're in:

Re: [R] Sweave, SweaveHooks and printing the label

2011-04-16 Thread Yihui Xie
Hi, I think you can search in the parent environments by brutal force like this (I don't guarantee it works for all Sweave documents): if ((n.parents - length(sys.parents())) = 3) { for (i in seq_len(n.parents) - 1) { if ('chunkopts' %in% ls(envir = sys.frame(i))) {

[R] (no subject)

2011-04-16 Thread stephen sefick
I have just upgraded to R 2.13 and have library(ggplot2) in my .Rprofile (among other things). when i start R I get an error message. Has something in the start up scripts changed? Is there a better way to specify the library calls in .Rprofile? Thanks for all of the help in advance. Error:

Re: [R] My added packages won't load in r.2.13.0

2011-04-16 Thread Duncan Murdoch
On 11-04-16 1:38 PM, Tyler Rinker wrote: Problem: I updated from r.2.12 to r.2.13 and when I use library(car) for example it says: library(car) Error in library(car) : there is no package called 'car' So I found that the packages I had before are located in:

Re: [R] (no subject)

2011-04-16 Thread Steve Lianoglou
Out of curiosity, do you have a problem calling `library(ggplot2)` from the R prompt (after R is finished spinning up)? I vaguely recall (~ 2 years ago) that I was trying to load some packages in my ~/.Rprofile since I thought I always wanted them in R anyway and had problems ... I've given up

Re: [R] CairoPDF, Fonts, and Windows 7

2011-04-16 Thread Liviu Andronic
On Sat, Apr 16, 2011 at 6:39 PM, Al Roark hrbuil...@hotmail.com wrote: Hi All: I have some basic questions about Cairo graphics engine. I'm trying to use the Cairo package to produce PDF output, mainly because I perceive it to be easy to use with a wide variety of fonts. You may also want

Re: [R] font and size times New Roman

2011-04-16 Thread Fabiane Silva
Thanks you for help 2011/4/13 Peter Alspach peter.alsp...@plantandfood.co.nz Tena koe Fabiane ?par In particular, various cex. parameters. These can be used with plot (e.g., plot(x, y, cex.axis=1.2)) HTH Peter Alspach -Original Message- From:

Re: [R] Identifying nearest topographic contours to data points

2011-04-16 Thread sam.e
Hi Rolf, Thanks for the feedback, I am indeed using the 'spatstat' package and now have the info I need. Thanks again, Sam -- View this message in context: http://r.789695.n4.nabble.com/Idetntifying-nearest-topographic-contours-to-data-points-tp3452462p3454680.html Sent from the R help mailing

[R] Applying interpolation within a convex hull

2011-04-16 Thread sam.e
Hi there, I have been using the Tps function (within the Fields package) for a while now to interpolate different sedimentary units. Due to the method of formation of the units I know that at some edges the thickness of the unit decreases to zero. I was wondering if there was someway to specify

Re: [R] spatstat regression troubles

2011-04-16 Thread Rolf Turner
On 17/04/11 02:17, Gregory Ryslik wrote: Hi Mr. Turner, You are correct that I am confused a bit by the RCode. Basically, I have 3772 observations of data and only about 500 500? You said 944 previously. Doesn't really matter, but. of them correspond to where people exist. For the

Re: [R] spatstat regression troubles

2011-04-16 Thread Rolf Turner
On 17/04/11 02:17, Gregory Ryslik wrote: Hi Mr. Turner, You are correct that I am confused a bit by the RCode. Basically, I have 3772 observations of data and only about 500 500? You said 944 previously. Doesn't really matter, but. of them correspond to where people exist. For the

Re: [R] Applying interpolation within a convex hull

2011-04-16 Thread Rolf Turner
On 17/04/11 10:01, sam.e wrote: Hi there, I have been using the Tps function (within the Fields package) for a while now to interpolate different sedimentary units. Due to the method of formation of the units I know that at some edges the thickness of the unit decreases to zero. I was wondering

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-04-16 Thread jouba
Dear all, when we have to do an exploration of our data with SEM So this is a lot of possibilities’ there isn’t programms done in order to test theses models Antra EL MOUSSELLY Date: Tue, 5 Apr 2011 09:49:08 -0500 From: ml-node+3428265-1156197921-225...@n4.nabble.com To:

[R] prb with data.table

2011-04-16 Thread yoda55
R.2.11.1 on Windows 7 When running data.table examples. DT = data.table(x=rep(c(a,b,c),each=3), y=c(1,3,6), v=1:9) setkey(DT,x) DT[a] I get the following error message Erreur dans seq.default(to = xlen, length = n) : length must be non-negative number When running the test.data.table(),

[R] if else statements in data frame

2011-04-16 Thread ozgrerg
Dear R experts, I have again a problem. Let I have a data frame like below: x y -- A A A B B B A B where x and y are the column names. I want to create a new column z where it is elements will be like that, if at each row has there at least one 'B', then z

[R] 600 people's time series

2011-04-16 Thread 苏江东Su Jiangdong
Hi there, I have a data frame DF of over 600 people's short term trade data in time order. Below is the super simplified structure of the data. id invest payout [1] 1 10 -1 [2] 1 33 33 [3] 1 20 -5 [4] 2

[R] cajolst

2011-04-16 Thread egle
Dear R users, I am quite new to R, so most of the problems I've encountered working with it are technical, absurd or simple things. Sorry. Despite this, I am struggling with cajolst function for a day and still nothing. The problem is that I can't get an estimate for the break point (which is in

[R] adding two colmns of a data frame

2011-04-16 Thread ozgrerg
It seems very simple but I could not find the way. I just want to add two columns of a data frame. I am doing the below operation: data$C=transform(data, data$A+data$B) However that return as a data frame. I will be glad if ypu help. Thanks a lot -- View this message in context:

[R] superimpose graphs

2011-04-16 Thread 苏江东Su Jiangdong
Hi there, I have a data frame DF of over 600 people's short term trade data in time order. Below is the simplified structure of the data. id invest payout [1] 1 10 -1 [2] 1 33 33 [3] 1 20 -5 [4] 2 200

Re: [R] adding two colmns of a data frame

2011-04-16 Thread ozgrerg
Sorry, sorry for taking your time. I solved the problem. data=transform(data,C= A+B) It is so simple. But if you dont know it is hard. Again sory for taking time -- View this message in context: http://r.789695.n4.nabble.com/adding-two-colmns-of-a-data-frame-tp3454556p3454572.html Sent from

Re: [R] if else statements in data frame

2011-04-16 Thread helin_susam
Hi ozgrerg, I am not a good R user, but according to me you can do this; data - data.frame(x=c(A,A,B,A), y=c(A,B,B,B)) for (i in 1:nrow(data)){ if(data$x[i]==B||data$y[i]==B) z[i]=c(B) else z[i]=c(NA) } cbind(data,z) -- View this message in context:

Re: [R] if else statements in data frame

2011-04-16 Thread ozgrerg
Thanks for the answers. They were very helpful. I did it like below. data$z - ifelse(data$x == A data$y == A, NA, B). That is enough for today. I guess I learned a enough today. Thanks to everbody who tried to help. -- View this message in context:

Re: [R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Jim Lemon
On 04/16/2011 11:04 PM, Josh B wrote: Dear listserv, Here is my latest formatting problem. I would like to rotate the x-axis labels by 45 degrees on a _barplot_. Apparently this is slightly different from the example given in the R FAQ, which is for rotating the x-axis labels on a scatterplot

[R] RJMCMC.

2011-04-16 Thread Marcus Vinicius
Dear R users, I´m studying about Bayesian Statistics. In this context, please, anyone have some basic script of RJMCMC (Reversible Jump Markov chain Monte Carlo) in R or WinBUGS? My aim is to learn how to implement this methodology. Thanks a lot. Marcus Vinicius [[alternative HTML version

Re: [R] prb with data.table

2011-04-16 Thread jim holtman
I would first recommend upgrading to the latest version of R. I am running R 2.12.2 on Windows 7 and it seem to run fine: DT = data.table(x=rep(c(a,b,c),each=3), y=c(1,3,6), v=1:9) setkey(DT,x) DT[a] x y v [1,] a 1 1 [2,] a 3 2 [3,] a 6 3 On Sat, Apr 16, 2011 at 3:30 PM, yoda55

Re: [R] superimpose graphs

2011-04-16 Thread jim holtman
Here is a start. This should create the plot: x - read.table(textConnection(id invest payout + 1 10 -1 + 1 33 33 + 1 20 -5 + 2 200 33 + 2 33-20 + 3 5 -5

Re: [R] superimpose graphs

2011-04-16 Thread jim holtman
This will add the regression line to it: x - read.table(textConnection(id invest payout + 1 10 -1 + 1 33 33 + 1 20 -5 + 2 200 33 + 2 33-20 + 3 5 -5 +

Re: [R] Counting elements in columns

2011-04-16 Thread Jim Silverton
I have two columns and I want to count hwo many pairs I have of the same element. For example. If I have a = c(1,2,3,4,5) b= c(12, 1, 34, 2, 5, 0, 10, 100, 11) It should return 3 (since 1, 2 and 5 occur in both columns). Columns need not be of the same length. -- Thanks, Jim.

Re: [R] RJMCMC.

2011-04-16 Thread Dennis Murphy
Hi: library(sos) # install first if you don't already have it findFn('reversible jump') It appears that a good starting point might be the RJaCGH package, which is concerned with reversible jump MCMC in CGH arrays. Other possiblilities may be found in the bim, evdbayes and ape packages.

Re: [R] Counting elements in columns

2011-04-16 Thread Dennis Murphy
length(intersect(a, b)) On Sat, Apr 16, 2011 at 8:04 PM, Jim Silverton jim.silver...@gmail.com wrote: I have two columns and I want to count hwo many pairs I have of the same element. For example. If I have a = c(1,2,3,4,5) b= c(12, 1, 34, 2, 5, 0, 10, 100, 11) It should return 3 (since 1,

[R] cube root

2011-04-16 Thread Branimir K. Hackenberger
This is some interesting: -8^(1/3) [1] -2 x=(-8:8) y=x^(1/3) y [1] NaN NaN NaN NaN NaN NaN NaN NaN 0.00 1.00 [11] 1.259921 1.442250 1.587401 1.709976 1.817121 1.912931 2.00 So, can anybody explain this?! (Why is

Re: [R] cube root

2011-04-16 Thread Niels Richard Hansen
?Syntax for precedence of operators. On 16/04/11 22.51, Branimir K. Hackenberger wrote: This is some interesting: -8^(1/3) [1] -2 x=(-8:8) y=x^(1/3) y [1] NaN NaN NaN NaN NaN NaN NaN NaN 0.00 1.00 [11] 1.259921 1.442250 1.587401