[R] regression with replication

2009-07-13 Thread Agus Susanto
Dear all, I would like to fit a linear regression with replication (on each year, observation is replicated, e.g 4 times). The independent variable ranges for instance 1-5 year, so I expect to have a linear fit of 5 points. For that purpose I do these (with dummy variables x and y):

[R] to get the R-Squared value

2009-07-10 Thread Agus Susanto
Dear all, I know there are 'coef', 'predict', 'fit' to get the corresponding outputs. Is that possible to get the value of R-squared from a 'lm' output? Many thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] to get R-squared value

2009-07-10 Thread Agus Susanto
Many thanks again for all help. I then also learnt that to get the Adjusted R-squared, I just issued command summary(lm(y~x))$adj.r.squared. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] equation on graph

2009-04-27 Thread Agus Susanto
Dear all, I want to write regression equation on R graph by taking the actual values of the regression coefficients. I have problem when writing X^2 (printed as X superscripts 2). I know there's a function expression but still no luck to use it in this case. Below is the R code as an example:

[R] multiple barplot

2009-03-18 Thread Agus Susanto
, TWOMKR,BLUP,BLUPQ,BLUP1M,BLUP2M,GAS)) # with cex=0.8 (but not working) barplot(d,beside=T,col=rainbow(5),names=c(CRTL,LSB,ONEMKR, TWOMKR,BLUP,BLUPQ,BLUP1M,BLUP2M,GAS),cex=0.8) Thanks in advance. -- Agus Susanto [[alternative HTML version deleted

[R] multiple comparison

2008-07-31 Thread Agus Susanto
)) # case 2 summary(glht(amod, linfct = mcp(trt = Ksub[,1:5])),test = adjusted(Westfall)) # case 3 summary(glht(amod, linfct = mcp(trt = Ksub[,])),test = adjusted(Westfall)) ## end of script All help are much appreciated. -- Agus Susanto [[alternative HTML version deleted

[R] mfrow

2008-05-13 Thread Agus Susanto
Dear members, I want to create 8 graphs and write it into one page using mfrow=c(4,2). How to make all graphs (including the titles, legends, line types) to be scale down (resized proportionally). As an illustration, below is the code: pdf(testmfrow.pdf) par(mfrow=c(4,2)) x-seq(1:10)

[R] superscript text on graph legend

2008-05-11 Thread Agus Susanto
Is that possible to create superscript text on the graph legend, for example to put cm2 (centimeter square) on the legend. Please show me how to do it. Thanks. -- Agus Susanto [[alternative HTML version deleted]] __ R-help@r-project.org