Re: [R] how to draw paired mosaic plot?

2015-02-08 Thread meng
On 2/7/2015 9:50 AM, meng wrote: If there are many character variables,and I want to get the mosaic plot of every pair of each variable,how to do then? If the variables are numeric, I can use pairs to get paired scatter plot. But as to the character variables, how to get the paired mosaic

Re: [R] how to draw paired mosaic plot?

2015-02-07 Thread meng
If both x and y are all character, paired scatter plot is a little bit strange I think. -- QQ: 1733768559 At 2015-02-06 23:52:34,Duncan Murdoch murdoch.dun...@gmail.com wrote: On 06/02/2015 6:46 AM, meng wrote: Hi all: If there are two numeric variable:x,y, and I can get paired

Re: [R] how to draw paired mosaic plot?

2015-02-07 Thread meng
: 1733768559 At 2015-02-07 17:04:26,Jim Lemon drjimle...@gmail.com wrote: Hi meng, It's not too hard to get a mosaic plot of two character variables: x-sample(LETTERS[1:3],20,TRUE) y-sample(LETTERS[24:26],20,TRUE) mosaicplot(table(x,y)) If you could tell us how the above is not what you want

[R] how to draw paired mosaic plot?

2015-02-06 Thread meng
Hi all: If there are two numeric variable:x,y, and I can get paired scatter plot by function pairs.But if x and y are character, and I want to get paired mosaic plot,which function should be used then? Many thanks! My best. -- QQ: 1733768559 [[alternative HTML version deleted]]

Re: [R] one sample test

2015-02-05 Thread meng
Very sorry that I ignore the question type.Yest,it's not an R question. Many thanks for your answer. -- QQ: 1733768559 At 2015-02-05 18:26:01,peter dalgaard pda...@gmail.com wrote: On 05 Feb 2015, at 09:20 , meng laomen...@163.com wrote: Hi all: If I want to test whether the mean

[R] one sample test

2015-02-05 Thread meng
Hi all: If I want to test whether the mean of a set of normal distributed data is different from a value(e.g. 0), I can use one sample t test . But if the data is not normal distributed,what kind of method should be used? Many thanks! My best. [[alternative HTML version

[R] How to change the order of the plot?

2014-05-11 Thread meng
boxplot(count ~ spray, data = InsectSprays) The order of the plot is: A,B,C,D,E,F. If I want the order of the plot is: F,B,E,A,D,C, how to do then? Many thanks! My best -- QQ: 1733768559 [[alternative HTML version deleted]] __

Re: [R] How to change the order of the plot?

2014-05-11 Thread meng
not wisdom. H. Gilbert Welch On Sun, May 11, 2014 at 6:42 AM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 11.05.2014 10:37, meng wrote: boxplot(count ~ spray, data = InsectSprays) The order of the plot is: A,B,C,D,E,F. If I want the order of the plot is: F,B,E,A,D,C, how to do

[R] a question about the output of plot

2014-04-15 Thread meng
Hi all: I met a question about the output of plot. I want to output 3 plots. Method1: by function histogram{lattice} Method2: by function hist{graphics} But method1 failed(the output is empty),and only method 2 works. I can't find out the reason,and many thanks for your help.

Re: [R] a question about the output of plot

2014-04-15 Thread meng
Yes,it works ! What's the reason for it? Many thanks! -- QQ: 1733768559 At 2014-04-15 14:36:41,Jim Lemon j...@bitwrit.com.au wrote: On 04/15/2014 11:46 AM, meng wrote: Hi all: I met a question about the output of plot. I want to output 3 plots. Method1: by function histogram

Re: [R] a question about the output of plot

2014-04-15 Thread meng
Thanks. -- QQ: 1733768559 At 2014-04-15 17:56:01,Jim Lemon j...@bitwrit.com.au wrote: On 04/15/2014 07:51 PM, meng wrote: Yes,it works ! What's the reason for it? Hi meng, As I understand it, the lattice graphics system produces plot objects, not actual output on a graphic device

[R] plotting the predict values of time series

2013-10-07 Thread meng
Hi all: I met a question about plotting the predict values of time series. The data is treering which belongs to R. I want to predict the next 3 years(1980,1981,1982) result. pred-predict(ar(treering),n.ahead=3) plot(treering) lines(pred$pred,col=red,lwd=3) I can only find a little bit red

Re: [R] question about lines

2013-09-19 Thread meng
Ok,many thanks for your detailed answer. At 2013-09-18 19:20:26,Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-09-18 1:38 AM, meng wrote: Oh,yes, I found out this according to your reply.Thanks. As to time series analysis, in order to show the effect of smoothing or filtering

Re: [R] question about lines

2013-09-18 Thread meng
. At 2013-09-18 08:49:51,Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-09-17 6:36 PM, meng wrote: Thanks for your reply. Is fitted(lm(...)) the same as values of lines(values)? If yes,then why the range of lines(values) is different from range(fitted(lm(...)))? You are plotting against

[R] question about lines

2013-09-17 Thread meng
Hi all: I met a question about lines. attach(cars) plot(dist ~ speed) #add the regression line to the plot lines(fitted(lm(dist~speed)) ~ speed) plot(dist ~ speed) #what kind of curve does the following command add to the plot? lines(fitted(lm(dist~speed))) My question is : what kind of

Re: [R] question about lines

2013-09-17 Thread meng
, meng wrote: Hi all: I met a question about lines. attach(cars) plot(dist ~ speed) #add the regression line to the plot lines(fitted(lm(dist~speed)) ~ speed) plot(dist ~ speed) #what kind of curve does the following command add to the plot? lines(fitted(lm(dist~speed))) My question

Re: [R] question about lines

2013-09-17 Thread meng
Thanks for your reply. Yes, abline is much better,but it can only add straight line,and lines(fitted(lm(y~x)) ~ x) can do the same thing but not constrain to straight line. At 2013-09-17 20:45:08,Bretschneider (R) brets...@xs4all.nl wrote: Dear meng, Re: Hi all: I met a question

[R] panel setting

2013-07-18 Thread meng
Hi all: My data: f1 f2 f3 f4 y 1 -4.45 3 6.44 3.721 2 25.66 121 39.03 3.55 0 3 -9.75 12 11.77 3.40 1 4 -12.09 17 13.75 3.33 0 5 -3.53 4 6.47 3.24 0 6 13.18 69 26.55 3.201 ... ... I want to plot f1 for y=0 and 1; f2 for y=0 and 1...and the same

[R] p values of lmer

2013-06-19 Thread meng
Hi all: I met a question about lmer. fm1 - lmer(Reaction ~ Days + (Days|Subject), sleepstudy) summary(fm1) ... Fixed effects: Estimate Std. Error t value (Intercept) 251.405 6.825 36.84 Days 10.467 1.5466.77 ... My question: Why p values of (Intercept)

Re: [R] error about MCA

2013-06-04 Thread meng
by the remaining variables ¨C and there are NO remaining variables. - David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77840-4352 From: meng [mailto:laomen...@163.com] Sent: Monday, June 3, 2013 8:55 PM To:dcarl

Re: [R] error about MCA

2013-06-03 Thread meng
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of meng Sent: Saturday, June 1, 2013 10:03 AM To: R help Subject: [R] error about MCA Hi,all: I want to perform multiple correspondance analysis via MCA{FactoMineR}. The data

[R] error about MCA

2013-06-01 Thread meng
Hi,all: I want to perform multiple correspondance analysis via MCA{FactoMineR}. The data is in the attachment. My code: dat-read.delim(e:\\mydata.txt,header=T) MCA(dat,quanti.sup=7,quali.sup=1:6) Error in `[.data.frame`(tab, , i) : undefined columns selected My question: Why does the error

Re: [R] p values of plor

2013-05-28 Thread meng
How to get p values from the result then? At 2013-05-28 13:54:27,David Winsemius dwinsem...@comcast.net wrote: On May 27, 2013, at 7:59 PM, meng wrote: Hi all: As to the polr {MASS} function, how to find out p values of every parameter? From the example of R help: house.plr

[R] p values of plor

2013-05-27 Thread meng
Hi all: As to the polr {MASS} function, how to find out p values of every parameter? From the example of R help: house.plr - polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing) summary(house.plr) How to find out the p values of house.plr? Many thanks. Best.

Re: [R] ordered and unordered variables

2013-05-23 Thread meng
Many thanks for your detailed reply. I'll read your mail thoroughly. Thanks! At 2013-05-23 21:56:29,Greg Snow 538...@gmail.com wrote: Meng, This really comes down to what question you are trying to answer. Before worrying about details of default contrasts and issues like that you

Re: [R] ordered and unordered variables

2013-05-22 Thread meng
Thanks. As to the data warpbreaks, if I want to analysis the impact of tension(L,M,H) on breaks, should I order the tension or not? Many thanks. At 2013-05-21 20:55:18,David Winsemius dwinsem...@comcast.net wrote: On May 20, 2013, at 10:35 PM, meng wrote: Hi all

Re: [R] ordered and unordered variables

2013-05-22 Thread meng
It's not homework. I met this question during my practical work via R. The boss is an expert of biology,but he doesn't know statistics.So I must find the right method to this work. At 2013-05-22 17:30:34,Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 22.05.2013 07:09, meng

[R] ordered and unordered variables

2013-05-20 Thread meng
Hi all: If the explainary variables are ordinal,the result of regression is different from unordered variables.But I can't understand the result of regression from ordered variable. The data is warpbreaks,which belongs to R. If I use the unordered variable(tension):Levels: L M H The result

Re: [R] question about poisson regression

2013-05-14 Thread meng
, meng wrote: Hi all: I have a question about poisson regression. My data: drug result count 1 1 8 1 254 2 1 20 2 2 44 My model: model- glm(count ~ drug*result, family = poisson) My result: summary(model) Coefficients

[R] question about poisson regression

2013-05-13 Thread meng
Hi all: I have a question about poisson regression. My data: drug result count 1 1 8 1 254 2 1 20 2 2 44 My model: model- glm(count ~ drug*result, family = poisson) My result: summary(model) Coefficients: Estimate Std. Error z

[R] question about 1-way anova

2013-05-11 Thread meng
Hi all: I have a question about one-way anova. The data is ¡°sleep¡±which belongs to R. code1: summary(lm(extra~group)) Estimate of group2(1.58) is the difference between mean of group1 and group2,and t value(1.861) and p value(0.0792) is the same as 2 sample t test,and the code is ¡°

Re: [R] quesion about model g1

2013-04-29 Thread meng
, meng wrote: Hello Achim: Sorry for another question about the model g1 in the last mail. As to model g2 and g3: g2 - glm(Freq ~ (age + drug + case)^2, data = df, family = poisson) g3 - glm(Freq ~ age * drug * case, data = df, family = poisson) anova(g2, g3, test = Chisq) I know clearly

[R] quesion about model g1

2013-04-28 Thread meng
g1 and g3,so I don't know what anova(g1, g3, test = Chisq) tests for. Also, what / sign following age in g1 refers to? Many thanks and sorry for many quesions. Best At 2013-04-24 22:22:55,Achim Zeileis achim.zeil...@uibk.ac.at wrote: On Wed, 24 Apr 2013, meng wrote: Hi,Achim

[R] about the loglm and glm---Re:Re: Regression on stratified count data

2013-04-24 Thread meng
Hi,Achim: Can all the analysis you mentioned via loglm be performed via glm(...,family=poisson)? Many thanks. At 2013-04-24 19:37:10,Achim Zeileis achim.zeil...@uibk.ac.at wrote: On Wed, 24 Apr 2013, meng wrote: Hi all: For stratified count data,how to perform regression analysis

Re: [R] about the loglm and glm---Re:Re: Regression on stratified count data

2013-04-24 Thread meng
Understand. Many thanks for your detailed explaination. At 2013-04-24 22:22:55,Achim Zeileis achim.zeil...@uibk.ac.at wrote: On Wed, 24 Apr 2013, meng wrote: Hi,Achim: Can all the analysis you mentioned via loglm be performed via glm(...,family=poisson)? Yes. ## transform table

[R] Regression on stratified count data

2013-04-23 Thread meng
Hi all: For stratified count data,how to perform regression analysis? My data: age case oc count 1 1 121 1 1 226 1 2 117 1 2 259 2 1 118 2 1 288 2 2 1 7 2 2 2 95 age: 1:40y 2:40y

Re: [R] different color indicates difference magnitude

2013-03-14 Thread meng
Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of John Kane Sent: Wednesday, March 13, 2013 11:19 AM To: meng; Pascal Oettli Cc: R help Subject

Re: [R] multi-comparison of means

2013-03-14 Thread meng
Many thanks At 2013-03-14 00:23:43,Richard M. Heiberger r...@temple.edu wrote: Meng, What seems to be going on is that the covariates are handled very differently in TukeyHSD and in glht. Please see the interaction_average and covariate_average arguments to glht. I ran your

Re: [R] different color indicates difference magnitude

2013-03-14 Thread meng
. At 2013-03-13 13:01:01,Pascal Oettli kri...@ymail.com wrote: Hi, The attachment has been deleted. Please be more specific. Regards, Pascal On 13/03/13 10:20, meng wrote: Hi all: Is there a plot tool to use different color indicates difference magnitude of data

[R] question about nls

2013-03-14 Thread meng
Hi,all: I met a problem of nls. My data: xy 60 0.8 80 6.5 100 20.5 120 45.9 I want to fit exp curve of data. My code: nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates I can't find out

Re: [R] different color indicates difference magnitude

2013-03-14 Thread meng
Many thanks for your reply. At 2013-03-14 19:22:41,Jim Lemon j...@bitwrit.com.au wrote: On 03/14/2013 12:10 PM, meng wrote: Thanks for your notice. At 2013-03-14 00:18:48,John Kanejrkrid...@inbox.com wrote: The R-help list strips most attachements other than text

Re: [R] different color indicates difference magnitude

2013-03-13 Thread meng
So strange to find the attachment is disappear. Resent again. At 2013-03-13 13:01:01,Pascal Oettli kri...@ymail.com wrote: Hi, The attachment has been deleted. Please be more specific. Regards, Pascal On 13/03/13 10:20, meng wrote: Hi all: Is there a plot tool to use different color

[R] multi-comparison of means

2013-03-13 Thread meng
Hi all: I have a question about multi-comparison. The data is in the attachment. My purpose: Compare the predicted means of the 3 methods(a,b,c) pairwisely. I have 3 ideas: #idea1 result_aov-aov(y~ method + x1 + x2) TukeyHSD(result_aov) difflwr upr p adj b-a 0.845

[R] different color indicates difference magnitude

2013-03-12 Thread meng
Hi all: Is there a plot tool to use different color indicates difference magnitude of data? The plot is in the attachment. Many thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] quesion about lm function

2013-03-11 Thread meng
Many thanks. I understand from your reply. Thanks. At 2013-03-11 15:45:14,PIKAL Petr petr.pi...@precheza.cz wrote: Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of meng Sent: Sunday, March 10, 2013 5:33 AM

[R] quesion about lm function

2013-03-09 Thread meng
Hi all: My data is in the attachment. I want to analysis the mean difference of y between 2 sex. My code: result_lm-lm(y~factor(sex) + x1 + x2) summary(result_lm) The result of factor(sex)m 136.83, is the mean difference of y between 2 sex,and the corresponding p value is 0.07618. My

Re: [R] quesion about lm function

2013-03-09 Thread meng
, 2013 at 10:35 AM, meng laomen...@163.com wrote: Hi all: My data is in the attachment. I want to analysis the mean difference of y between 2 sex. My code: result_lm-lm(y~factor(sex) + x1 + x2) summary(result_lm) The result of factor(sex)m 136.83, is the mean difference of y between 2 sex

Re: [R] quesion about lm function

2013-03-09 Thread meng
). On Sat, Mar 9, 2013 at 3:35 AM, meng laomen...@163.com wrote: Hi all: My data is in the attachment. I want to analysis the mean difference of y between 2 sex. My code: result_lm-lm(y~factor(sex) + x1 + x2) summary(result_lm) The result of factor(sex)m 136.83, is the mean difference of y between 2 sex

[R] quesion about SS of ANOVA

2013-02-24 Thread meng
Hi all: I have a quesion about ANOVA: Is SS(Sum of Square) of a specific factor constant with the number of factors changing? dat1 includes one factor g1,and g1's SS is called SS_g1_dat1. dat2 includes two factors g1,g2,and g1's SS is called SS_g1_dat2. My quesion is: Is SS_g1_dat1 equals to

[R] a question about the computation of expression

2013-01-04 Thread meng
Hi all: I have a question about the computation of expression: y = 1+(2x1+2)-3*(5x1-1)+(3x2+3)-2*(x2-1) The result of y is: y = 11-13x1+x2 How can I compute the result of y via R function? Many thanks! My best. [[alternative HTML version deleted]]

Re: [R] a question about the computation of expression

2013-01-04 Thread meng
No,I have no x1 and x2 values. At 2013-01-04 17:32:24,PIKAL Petr petr.pi...@precheza.cz wrote: Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of meng Sent: Friday, January 04, 2013 8:00 AM To: R help Subject: [R

Re: [R] a question about the computation of expression

2013-01-04 Thread meng
Thanks. At 2013-01-04 17:41:23,Jorge I Velez jorgeivanve...@gmail.com wrote: Dear meng, Check I understood correctly, the Ryacas package might do what you want. Check its vignette at http://cran.r-project.org/web/packages/Ryacas/vignettes/Ryacas.pdf Best, Jorge.- On Fri, Jan 4

Re: [R] How to multiple the vector and variables from dataframe

2012-12-31 Thread meng
Ok,I'll follow your suggestion. Thanks! At 2012-12-31 11:20:17,arun smartpink...@yahoo.com wrote: HI Meng, Just try: rep(z,rach=nrow(dat)) #[1] 0.1 10.0 100.0 rep(z,chair=nrow(dat)) #[1] 0.1 10.0 100.0 rep(z,times=nrow(dat)) #[1] 0.1 10.0 100.0 0.1 10.0 100.0 0.1 10.0

[R] How to multiple the vector and variables from dataframe

2012-12-30 Thread meng
hi all: Here's a dataframe(dat) and a vector(z): dat: x1 x2x3 0.2 1.2 2.5 0.5 2 5 0.8 3 6.2 z [1] 10 100 100 I wanna do the following: 10*x1,100*x2,1000*x3 My solution is using the loop for z and dat(since the length of z is the same as ncol of dat),which is

Re: [R] How to multiple the vector and variables from dataframe

2012-12-30 Thread meng
wrote: Hi Meng, A one-liner would be dat*rep(z, each=nrow(dat)) Cheers, Andrius 2012/12/30 meng laomen...@163.com hi all: Here's a dataframe(dat) and a vector(z): dat: x1 x2x3 0.2 1.2 2.5 0.5 2 5 0.8 3 6.2 z [1] 10 100 100 I wanna do the following: 10*x1,100

Re: [R] How to multiple the vector and variables from dataframe

2012-12-30 Thread meng
is: x1 x2 x3 1 0.1 40 700 2 0.2 50 800 3 0.3 60 900 At 2012-12-31 00:13:33,Neal H. Walfield n...@walfield.org wrote: At Sun, 30 Dec 2012 18:26:45 +0800 (CST), meng wrote: hi all: Here's a dataframe(dat) and a vector(z): dat: x1 x2x3 0.2 1.2 2.5 0.5 2 5 0.8

Re: [R] How to multiple the vector and variables from dataframe

2012-12-30 Thread meng
: On 30-12-2012, at 11:26, meng laomen...@163.com wrote: hi all: Here's a dataframe(dat) and a vector(z): dat: x1 x2x3 0.2 1.2 2.5 0.5 2 5 0.8 3 6.2 z [1] 10 100 100 I wanna do the following: 10*x1,100*x2,1000*x3 My solution is using the loop for z and dat

Re: [R] How to multiple the vector and variables from dataframe

2012-12-30 Thread meng
(dat)) * c(2, 3) [,1] [,2] [,3] x1246 x2 33 36 39 Andrius 2012/12/30 Neal H. Walfield n...@walfield.org At Sun, 30 Dec 2012 18:26:45 +0800 (CST), meng wrote: hi all: Here's a dataframe(dat) and a vector(z): dat: x1 x2x3 0.2 1.2 2.5

Re: [R] How to multiple the vector and variables from dataframe

2012-12-30 Thread meng
,] 8 300 6200 A.K. - Original Message - From: meng laomen...@163.com To: R help r-help@r-project.org Cc: Sent: Sunday, December 30, 2012 5:26 AM Subject: [R] How to multiple the vector and variables from dataframe hi all: Here's a dataframe(dat) and a vector(z): dat: x1 x2

Re: [R] How to multiple the vector and variables from dataframe

2012-12-30 Thread meng
Many thanks arun! Your answer is the best one :) At 2012-12-31 10:51:35,arun smartpink...@yahoo.com wrote: HI Meng, NO problem. #In fact, sweep(dat,2,z,*) #will be data.frame # x1 x2 x3 #1 2 120 2500 #2 5 200 5000 #3 8 300 6200 str(sweep(dat,2,z,*)) #'data.frame':3 obs

[R] How to do it through 1 step?

2012-12-24 Thread meng
A data set(dat),has 2 variables: x and a, and 100 rows. I wanna add 2 variables,and call the new data set dat1: var1:f = a/median(a) var2:x_new = x*f My solution: dat1-transform(dat,f = a/median(a),x_new = x*f) But gets error reply which says that f is not exits since dat has no variables

Re: [R] How to do it through 1 step?

2012-12-24 Thread meng
. set.seed(5) dat-data.frame(x=sample(1:20,6,replace=TRUE),a=sample(20:40,6,replace=TRUE)) dat1-transform(dat,f=a/median(a),x_new=x*(a/median(a))) head(dat1,2) # x af x_new #1 5 31 1.016393 5.081967 #2 14 36 1.180328 16.524590 A.K. - Original Message - From: meng laomen

Re: [R] How to do it through 1 step?

2012-12-24 Thread meng
$f-y$a/median(y$a);y$x_new-y$f*y$x;y})) A.K. From: meng laomen...@163.com To: arun smartpink...@yahoo.com Cc: R help r-help@r-project.org Sent: Monday, December 24, 2012 5:29 AM Subject: Re:Re: [R] How to do it through 1 step? Yes,this is my final solution

[R] How to compute time interval?

2011-11-10 Thread Lao Meng
time1 = 2008-03-09 time2 = 2010-9-10 How to compute how many years between time1 and time2? Thanks! best [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] How to compute time interval?

2011-11-10 Thread Lao Meng
t2-t1 is ok,but only can getTime difference of 786 days,but I wanna get the 786 only.How can I do then? Thanks! 2011/11/11 Lao Meng laomen...@gmail.com time1 = 2008-03-09 time2 = 2010-9-10 How to compute how many years between time1 and time2? Thanks! best [[alternative HTML

Re: [R] How to compute time interval?

2011-11-10 Thread Lao Meng
as.numeric() is work Settled! 2011/11/11 Lao Meng laomen...@gmail.com t2-t1 is ok,but only can getTime difference of 786 days,but I wanna get the 786 only.How can I do then? Thanks! 2011/11/11 Lao Meng laomen...@gmail.com time1 = 2008-03-09 time2 = 2010-9-10 How to compute how many

[R] About the statistics for ratio comparison

2011-10-28 Thread Meng Wu
between the two ratios. Thanks, Meng [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] How to get the descriptive statistic of the whole dataframe?

2011-08-18 Thread Lao Meng
Hi all: If I have a dataframe of N columns.If I wanna get the min(or max,or mean...etc)of the whole dataframe,how to do it quickly? What I can do is only: min(data[,1:ncol(data)]) Any other suggestion? Thanks! best [[alternative HTML version deleted]]

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

2011-08-18 Thread Lao Meng
:57, schrieb 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

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
- number of parameters) degrees of freedom. cc-s1$coef[(Intercept),1:2] 2*(1-pt(cc[1]/cc[2],df=18)) hth. Am 16.08.2011 07:25, schrieb Lao Meng: Hi all: I have a question about lm on t-test. data(sleep) I wanna perform t-test to test the difference between the 2 groups: I

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

2011-08-16 Thread Lao Meng
...1k --- Sent from my phone. Please excuse my brevity. Lao Meng laomen...@gmail.com wrote: The mean of group1 is 0.75,just the same as intercept. Acturally,R treated group1 as reference,so intercept is just group1

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

2011-08-16 Thread Lao Meng
Hi all: My data:data(sleep) If I wanna calculate each group's extra,what I can do is: #method1 attach(sleep) mean(extra[group==1]) mean(extra[group==1]) #method2 result-matrix(,0,2) g-split(sleep,sleep$group) for(i in 1:length(g)) {

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

2011-08-16 Thread Lao Meng
Sorry,I miss a word:If I wanna calculate each group's mean extra 2011/8/16 Lao Meng laomen...@gmail.com Hi all: My data:data(sleep) If I wanna calculate each group's extra,what I can do is: #method1 attach(sleep) mean(extra[group==1]) mean(extra[group==1]) #method2 result-matrix

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

2011-08-15 Thread Lao Meng
Hi all: I have a question about lm on t-test. data(sleep) I wanna perform t-test to test the difference between the 2 groups: I can use: t.test(extra~group) The t.test result shows that:t = -1.8608; mean1=0.75,mean2=2.33 But I still wanna use: summary(lm(extra~group)) Intercept=0.75,which

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

2011-08-15 Thread Lao Meng
#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Lao Meng laomen...@gmail.com wrote: Hi all: I have a question about lm on t-test. data(sleep) I wanna perform t-test

Re: [R] a question about glht function

2011-07-27 Thread Lao Meng
Here's another question: What's kind of difference does glht tests? In other words, If I get 4 intercepts and 4 slopes for all levels of GROUP,then glht tests for the difference of the 4 intercepts or 4 slopes,or something else? Thanks. 2011/7/27 Lao Meng laomen...@gmail.com Yes. According

[R] a question about glht function

2011-07-26 Thread Lao Meng
Hi all: There's a question about glht function. My data:data_ori,which inclue CD4, GROUP,time. f_GROUP-factor(data_ori$GROUP) f_GROUP is a factor of 3 levels(0,1,2,3) result - lme(sqrt(CD4) ~ f_GROUP*time ,random = ~time|ID,data=data_ori) glht(result, linfct = mcp(f_GROUP=Tukey) ) Error in

Re: [R] a question about glht function

2011-07-26 Thread Lao Meng
Yes. According to your suggestion,I modified my code.It works well. Thanks you very much. My best. 2011/7/26 Peter Ehlers ehl...@ucalgary.ca On 2011-07-26 00:16, Lao Meng wrote: Hi all: There's a question about glht function. My data:data_ori,which inclue CD4, GROUP,time. f_GROUP

[R] question about linear mixed model

2011-07-17 Thread Lao Meng
Hi all: I have a question about linear mixed model. my linear mixed model with randomized slope and intercept with interaction of time and group(g1,g2,g3): model- glmmPQL(log10(CD4) ~ time + factor(group)+ time:factor(group), random = ~time|id) What I get is only the main and interaction of time

[R] How to compare ratio from multiple groups?

2011-07-05 Thread Lao Meng
If I have 3 groups,and for each group,I get the ratio(e.g. incidence rate). Now I wanna compare 3 ratio pairwise,and get the corresponding p values,i.e: group1 vs group2 ,p value=? group1 vs group3 ,p value=? group2 vs group3 ,p value=? Which statistical test should be used? Thanks a lot for

[R] About the covariant

2011-06-27 Thread Lao Meng
Hi all,I have some questions about the covariants of regression. My target: To explore the trend of CD4 level through a period of time. Response variable: CD4 count Explanatory variable:time Also, the demology information is available,such as gender,occupation,income level... Q1,Are these

Re: [R] About the covariant

2011-06-27 Thread Lao Meng
(High). 2011/6/28 David Winsemius dwinsem...@comcast.net On Jun 27, 2011, at 10:02 PM, Lao Meng wrote: Hi all,I have some questions about the covariants of regression. My target: To explore the trend of CD4 level through a period of time. Response variable: CD4 count Explanatory

Re: [R] A better way to do this

2011-05-20 Thread Lao Meng
You may try xyplot 2011/5/20 1Rnwb sbpuro...@gmail.com Hello gurus, I have a dataframe containing two groups viz., 'control' and 'case', each of these groups contains longitudinal data for 100 subjects. I have to plot all these subjects on a single chart and then put a regression line

[R] Help with 2-D plot of k-mean clustering analysis

2011-05-18 Thread Meng Wu
since the huge number of variables. One possible way is to project the multidimensional space into 2-D platform, but I could not find any good way to do that. Any suggestions or comments will be really helpful! Thanks, Meng [[alternative HTML version deleted

[R] competitive risk model

2011-04-28 Thread Lao Meng
Hi all: Which function or package can perform competitive risk model? Thanks a lot! My best [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] is this an ANOVA ?

2011-04-13 Thread Lao Meng
You may try the following to perform anova: anova(lm(y~x)) or summary(aov(y~x)) 2011/4/13 Ubuntu Diego ubuntu.di...@gmail.com Hi all, I have a very easy questions (I hope). I had measure a property of plants, growing in three different substrates (A, B and C). The rest of the

Re: [R] qcc.overdispersion-test

2011-04-06 Thread Lao Meng
hi: Another question abour overdispersion test. I wanna make sure that: if p value0.05,then the data is NOT overdispersion; if p value=0.05,then the data IS overdispersion. I'm not sure whether it's true,just get the above conclusion from simulated data. Thanks for your help. 2011/4/2

[R] Sample size of longitudinal and skewed data

2011-03-21 Thread Lao Meng
Hi all: I have a question about the sample size calculation. It's a pilot study,which includes 2 groups(low,high),3 time point(3,6,9 monthes).Each person has 3 results which according to the 3 time points.So it's a longitudinal study. I want to calculate the minimum sample size from the pilot

[R] sample size of 2 groups of skewed data

2011-03-15 Thread Lao Meng
Hi all: I have a question on sample size calculation of 2 groups of data. If 2 groups of data are all normal distribution, then I can use the function n.indep.t.test.eq from samplesize package.But if 2 groups of data are all skewed distribution, but not normal distribution,how can I calculate the

Re: [R] Boxplot problem

2011-03-09 Thread Lao Meng
No,even there's only one observation,boxplot can still be drawn. x-1 boxplot(x) or x-1:3 boxplot(x) ... 2011/3/9 Dennis Murphy djmu...@gmail.com Hi: A box plot is based on a five number summary, so you need at a minimum five observations (and preferably at least twice that) to make a

Re: [R] regression with categorical nuisance variable

2011-02-28 Thread Lao Meng
You may try analysis of covariance. But,as you sayThere are no gender differences in age ,then why not combine 2 gender's age and ignore the gender? 2011/3/1 Jonathan DuBois jonathan.m.dub...@gmail.com Hi, I am new to R, so I am unsure of the formula to set up this analysis. I would like to

Re: [R] How to change dataframe to tables

2011-02-20 Thread Lao Meng
Thanks! It works well. 2011/2/18 Dimitris Rizopoulos d.rizopou...@erasmusmc.nl say, 'Dat' is your data frame, then one way to do it is: with(Dat, tapply(freq, list(hair, eye, sex), c)) I hope it helps. Best, Dimitris On 2/18/2011 8:50 AM, Lao Meng wrote: The data

Re: [R] How to change dataframe to tables

2011-02-20 Thread Lao Meng
Thanks! It works well. 2011/2/18 Henrique Dallazuanna www...@gmail.com Try this: xtabs(Freq ~ Hair + Eye + Sex, Dat) Using Dimitri's Dat example. On Fri, Feb 18, 2011 at 5:50 AM, Lao Meng laomen...@gmail.com wrote: The data is in the attachment. What I wanna get is: , , Sex

Re: [R] How to change dataframe to tables

2011-02-20 Thread Lao Meng
Well,it's my daily work on duty,not homework:) 2011/2/18 Dennis Murphy djmu...@gmail.com This is a built-in dataset in R - see ?HairEyeColor and str() it. I smell homework... Dennis On Thu, Feb 17, 2011 at 11:50 PM, Lao Meng laomen...@gmail.com wrote: The data is in the attachment

[R] How to change dataframe to tables

2011-02-17 Thread Lao Meng
The data is in the attachment. What I wanna get is: , , Sex = Male Eye HairBrown Blue Hazel Green Black32 1110 3 Brown53 502515 Red 10 10 7 7 Blond 3 30 5 8 , , Sex = Female Eye HairBrown Blue Hazel Green

[R] 3 questions about the poisson regression of contingency table

2011-02-16 Thread Lao Meng
Hi all: I have 3 questions about the poisson regression of contingency table. Q1¡¢How to understand the independent poisson processas many books or paper mentioned? For instance: Table1 --- treat canernon-cancersum

[R] 3 questions about the poisson regression of contingency table

2011-02-16 Thread Lao Meng
Hi all: I have 3 questions about the poisson regression of contingency table. Q1¡¢How to understand the independent poisson processas many books or paper mentioned? For instance: Table1 --- treat canernon-cancersum

[R] question about result of loglinear analysis

2011-01-18 Thread Lao Meng
Hi all: Here's a question about result of loglinear analysis. There're 2 factors:area and nation.The raw data is in the attachment. I fit the saturated model of loglinear with the command: glm_sat-glm(fre~area*nation, family=poisson, data=data_Analysis) After that,I extract the coefficients:

[R] Fwd: question about result of loglinear analysis

2011-01-18 Thread Lao Meng
-- Forwarded message -- From: Lao Meng laomen...@gmail.com Date: 2011/1/19 Subject: Re: [R] question about result of loglinear analysis To: David Winsemius dwinsem...@comcast.net My command and result are : result_sat-summary(glm_sat) result_coe-result_sat$coefficients

  1   2   >