[R] list contingency tables

2018-11-08 Thread li li
Hi all, I am trying to list all the 4 by 2 tables with some fixed margins. For example, consider 4 by 2 tables with row margins 1,2,2,1 and column margins 3,3. I was able to do it using the code below. However, as seen below, I had to first count the total number of tables with the specific

Re: [R] Identify row indices corresponding to each distinct row of a matrix

2018-11-08 Thread li li
t; Cm <- as.matrix( C ) > D <- which( !duplicated( Cm, MARGIN=1 ) ) > nCm <- nrow( Cm ) > F <- lapply( D, function(d) { >idxrep <- rep( d, nCm ) >which( 0 == unname( rowSums( Cm[idxrep,] != Cm ) ) ) > } ) > > > On November 8, 2018 1:42:40 PM PST, l

Re: [R] Identify row indices corresponding to each distinct row of a matrix

2018-11-08 Thread li li
14" "7-15" "8-16" "1-9" >> >"2-10" >> >"3-11" "4-12" "5-13" "6-14" >> >[15] "7-15" "8-16" >> >> ## Then maybe: >> >> tapply(seq_along(vec),vec, I) &

[R] Identify row indices corresponding to each distinct row of a matrix

2018-11-07 Thread li li
Hi all, I use the following example to illustrate my question. As you can see, in matrix C some rows are repeated and I would like to find the indices of the rows corresponding to each of the distinct rows. For example, for the row c(1,9), I have used the "which" function to identify the row

Re: [R] question with integrate function

2018-02-06 Thread li li
nction is approximately constant (in > particular, zero) over nearly all its range it is possible that the result > and error estimate may be seriously wrong." > > You could try to integrate over a finite interval, say (7, 12). > > Göran Broström > > > On 2018-02-06

Re: [R] question with integrate function

2018-02-06 Thread li li
Sorry. I meant in the previous email that the function h() is a monotone decreasing function. Thanks very much. 2018-02-06 13:32 GMT-05:00 li li <hannah@gmail.com>: > Hi all, > The function h below is a function of c and it should be a monotone > increasing function sinc

[R] question with integrate function

2018-02-06 Thread li li
Hi all, The function h below is a function of c and it should be a monotone increasing function since the integrand is nonnegative and integral is taken from c to infinity. However, as we can see from the plot, it is not shown to be monotone. Something wrong with the usage of integrate function?

[R] An iterative function

2017-10-29 Thread li li
Dear all, The function f() below is a function of m1 and m2, both of which are matrices with 3 rows. The function works sequentially one row after another. So altogether there are three stages. I am trying to update the coding to write a generic function that will work for arbitrary k stages.

Re: [R] problem with "unique" function

2017-07-28 Thread li li
applying unique. In this particular case, it seems like all numbers > are multiples of 1/30, so another idea could be to multiply by 30, round, > and divide by 30. > > -pd > > > On 28 Jul 2017, at 17:17 , li li <hannah@gmail.com> wrote: > > > > I have the joint

[R] problem with "unique" function

2017-07-28 Thread li li
I have the joint distribution of three discrete random variables z1, z2 and z3 which is captured by "z" and "prob" as described below. For example, the probability for z1=0.46667, z2=-1 and z3=-1 is 2.752e-13. Also, the probability adds up to 1. > head(z) z1 z2 z3 [1,]

Re: [R] Adding zeros in each dimension of an array

2017-06-07 Thread li li
ience > though implementing that last expression without hardcoding the sequences > may not be obvious: > > expandArray <- function( a ) { > b <- array( 0, dim = dim( a ) + 1 ) > do.call( `[<-`, c( list( b ), lapply( dim( a ), seq.int ), list( a ) ) ) > } > expandA

[R] Adding zeros in each dimension of an array

2017-06-07 Thread li li
For a data frame, we can add an additional row or column easily. For example, we can add an additional row of zero and an additional row of column as follows. Is there an easy and similar way to add zeros in each dimension? For example, for array(1:12, dim=c(2,2,3))? Thanks for your help!!

Re: [R] An R question

2017-06-07 Thread li li
> +49 (0) 2631 9772-243 > https://www.researchgate.net/profile/Ivan_Calandra > > > On 07/06/2017 16:32, li li wrote: > >> Hi all, >>In checking my R codes, I encountered the following problem. Is there a >> way to fix this? >> I tried to specify options(digi

[R] An R question

2017-06-07 Thread li li
Hi all, In checking my R codes, I encountered the following problem. Is there a way to fix this? I tried to specify options(digits=). I did not fix the problem. Thanks so much for your help! Hanna > cdf(pmass)[2,2]==pcum[2,2][1] FALSE> cdf(pmass)[2,2][1] 0.758> > pcum[2,2][1]

Re: [R] subletting an array according to dimnames

2017-06-02 Thread li li
That works. Thank you! 2017-06-02 8:00 GMT-04:00 Adams, Jean <jvad...@usgs.gov>: > Have you tried P2["20", "10", "0"] ? > > Jean > > On Thu, Jun 1, 2017 at 3:10 PM, li li <hannah@gmail.com> wrote: > >> Hi all, >> I hav

[R] subletting an array according to dimnames

2017-06-01 Thread li li
Hi all, I have a three dimensional array with the corresponding dimension names. I would like to subset the array according to the dimension names. For example, suppose I want to extract the values corresponding to A=20, B=10, C=0. I know I can do: P2[dimnames(P2)$A==20, dimnames(P2)$B==10,

Re: [R] [FORGED] Re: Question on function "scatterplot3d"

2017-06-01 Thread li li
Thanks so much for the help!! Hanna 2017-06-01 11:02 GMT-04:00 Uwe Ligges : > > > On 01.06.2017 10:03, Rolf Turner wrote: > >> On 01/06/17 19:54, Uwe Ligges wrote: >> >>> A design flaw, whether the labels are cut depends somewhat on the sizce >>> of the

[R] Question on function "scatterplot3d"

2017-05-31 Thread li li
Hi all, I have a question with regard to making plots using function "scatterplot3d". Please see the example below. It looks like, for y axis, the tickmark text was cutoff. The number "10" does not show up completely. I tried to work with par(mpg). It does not seem to work. Hope to get some

Re: [R] creat contingency tables with fixed row and column margins

2017-05-27 Thread li li
I meant that the post in your link above was NOT asked by me. 2017-05-27 16:53 GMT-04:00 li li <hannah@gmail.com>: > Hi Dave, > Thanks for your reply but the post in your link above was certainly > asked by me. >Hanna > > 2017-05-27 16:04 GMT-04:00

Re: [R] creat contingency tables with fixed row and column margins

2017-05-27 Thread li li
Hi Dave, Thanks for your reply but the post in your link above was certainly asked by me. Hanna 2017-05-27 16:04 GMT-04:00 David Winsemius <dwinsem...@comcast.net>: > > > On May 27, 2017, at 12:49 PM, li li <hannah@gmail.com> wrote: > > > > Hi all, >

[R] creat contingency tables with fixed row and column margins

2017-05-27 Thread li li
Hi all, Is there an R function that can be used to enumerate all the contingency tables with fixed row and column margins. For example, can we list all 3 by 3 tables with row margins 3,6,6 and column margins 5,5,5. Thanks very much! Hanna [[alternative HTML version deleted]]

Re: [R] Finding Infimum in R

2017-04-10 Thread li li
Yes. If the function f takes the value zero at some discontinuity point, then the code gives the inf of the set I described. Otherwise, it is an approximation since we need to worry about numerical accuracy. 2017-04-10 14:08 GMT-04:00 Bert Gunter : > Well, I haven't

Re: [R] Finding Infimum in R

2017-04-09 Thread li li
eley Breathed in his "Bloom County" comic strip ) > > > On Sun, Apr 9, 2017 at 1:28 PM, li li <hannah@gmail.com> wrote: > > Dear all, > > For a piecewise function F similar to the attached graph, I would like > to > > find > >

[R] Looking for

2017-04-09 Thread li li
Dear all, For a piecewise function F similar to the attached graph, I would like to find inf{x| F(x) >=0}. I tried to uniroot. It does not seem to work. Any suggestions? Thank you very much!! Hanna F.pdf Description: Adobe PDF document

[R] standard error for regression coefficients corresponding to factor levels

2017-03-16 Thread li li
Hi all, I have the following data called "data1". After fitting the ancova model with different slopes and intercepts for each region, I calculated the regression coefficients and the corresponding standard error. The standard error (for intercept or for slope) are all the same for different

Re: [R] Test individual slope for each factor level in ANCOVA

2017-03-16 Thread li li
, > > John > > - > John Fox, Professor > McMaster University > Hamilton, Ontario, Canada > Web: http://socserv.mcmaster.ca/jfox/ > > > > > On 2017-03-15, 9:43 PM, "R-help on behalf of li li" > <r-help-boun..

[R] Test individual slope for each factor level in ANCOVA

2017-03-15 Thread li li
Hi all, Consider the data set where there are a continuous response variable, a continuous predictor "weeks" and a categorical variable "region" with five levels "a", "b", "c", "d", "e". I fit the ANCOVA model as follows. Here the reference level is region "a" and there are 4 dummy variables.

Re: [R] nested structure for Ancova

2017-03-12 Thread li li
With either of those, area:month and area:group and Residuals add up. > > > On Sun, Mar 12, 2017 at 10:39 li li <hannah@gmail.com> wrote: > >> Hi All, >> I have a dataset which contains 4 variables: area, group, time, y, >> Area is a factor that has two levels A a

[R] nested structure for Ancova

2017-03-12 Thread li li
Hi All, I have a dataset which contains 4 variables: area, group, time, y, Area is a factor that has two levels A and B, group is a factor that is nested within area. There are four groups within each area. y is the response variable, and time refers to different days. Below is the how data

[R] weighted sum of independent chi square random variables

2017-02-20 Thread li li
Hi all, Is there a function in R that can calculate the quantiles or percentiles for the weighted sum of independent chi square random variables. I found a few functions for calculating probability distribution function for such random variables (e.g. pchisqsum..), but can not find any function

[R] ancova for dependent response

2016-11-21 Thread li li
Hi all, Is there an R function which can handles dependent response in Analysis of covariance model. The dependence structure is known and is there to account for it in ANCOVA analysis in R? Thanks. Hanna [[alternative HTML version deleted]]

[R] drm function in drc package for fitting dose response curve

2016-11-08 Thread li li
Hi all, When using drm function in drc package, we can fit several does response curves simultaneously or fitting each curve separately. If we fit simultaneous curves without any constraining condition, for example, parallelism condition, will we get the same results as the results obtained by

Re: [R] plot.drm in "drc" package

2016-09-01 Thread li li
GMT-04:00 PIKAL Petr <petr.pi...@precheza.cz>: > Hi > > Thanks for code. > see in line > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of li li > > Sent: Tuesday, August 30, 2016 5:07 PM > > To: r-help <r

Re: [R] plot with different symbols and colors according to the factor levels

2016-09-01 Thread li li
ty Modeler INTERNET: cl...@math.utah.edu > Department of Ecology VOICE: (360) 407-6815 > PO Box 47600FAX:(360) 407-7534 > Olympia, WA 98504-7600 > > USPS: PO Box 47600, Olympia, WA 98504-7600 >

[R] plot with different symbols and colors according to the factor levels

2016-08-30 Thread li li
Hi all, I have the following data. I want to plot the data (y ~ conc) with different symbols and colors corresponding to different levels of the factor sample. I could create a column with color and pch and then do the plot, but I am sure there are much better ways. Can anyone make suggestions?

[R] plot.drm in "drc" package

2016-08-30 Thread li li
Hi all, I am trying to use the drc package to fit 4L curve. I am so confused about the plot.drm function in the drc package. Particularly, I am confused about the scale of the xaxis in the plots generated using the plot.drm function. See the example below: ## generate data and fit the model

Re: [R] Help on improving an algorithm

2016-07-28 Thread li li
couple of minor points: > dim(tmp_a)[1] can be replaced by nrow(tmp_a) > in the original code, apply() can be replaced by rowSums() > It might be faster if rowSums() was replaced by .rowSums(); I haven't > tried that. > > -Don > > > -- > Don MacQueen > > Lawren

[R] Help on improving an algorithm

2016-07-27 Thread li li
Hi all, I have four matrix tmp_a, tmp_b, tmp_c and tmp_d whose dimensions are shown as below. I want to take one row from each of these matrices and then put the four selected rows into a matrix. I want to count the number of such matrices for which the vector of row sum is less than or equal to

[R] Fixed Effects in lme function

2016-07-07 Thread li li
Dear all, For the data below, I would like to fit a model with common random slope and common random intercept as shown below. I am interested in obtaining separate fixed effect estimates (intercept and slope and corresponding hypothesis test) for each method. Instead of performing the

Re: [R] [R-sig-ME] multcomp package

2016-06-06 Thread li li
Min Q1 Med Q3 Max -2.67575293 -0.51633192 0.06742723 0.59706762 2.81061874 Number of Observations: 69 Number of Groups: 7 2016-06-06 11:21 GMT-04:00 Gabriel Baud-Bovy <baud-bovy.gabr...@hsr.it>: > On 06/06/2016 4:57 PM, li li wrote: >

[R] multcomp package

2016-06-06 Thread li li
Hi all, After fitting a random slope and random intercept model using lme function, I want to test whether each of the fixed slopes is equal to zero (The output of model is below). Can this be done (testing each individual slope) using multcomp package? Thanks much for the help. Hanna >

[R] Fwd: model specification using lme

2016-06-01 Thread li li
kelinx <thierry.onkel...@inbo.be> Date: 2016-05-30 4:40 GMT-04:00 Subject: Re: [R] model specification using lme To: li li <hannah@gmail.com> Cc: r-help <r-help@r-project.org> Dear Hanna, None of the models are correct is you want the same random intercept for the differe

[R] model specification using lme

2016-05-29 Thread li li
Hi all, For the following data, I consider the following random intercept and random slope model. Denote as y_ijk the response value from *j*th individual within *i*th method at time point *k*. Assume the following model for y_ijk: y_ijk= (alpha_0+ tau_i +a_j(i))+(beta_i+b_j(i)) T_k +

[R] read multiple sheets of excel data into R

2016-05-28 Thread li li
Hi all, I tried to use the package "XLConnect" to read excel data into R. I got the following error message: Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and

Re: [R] Error because of large dimension

2016-01-24 Thread li li
8e+16 bytes of RAM, i.e. 29327331 GiB = >> 28640 TiB = 28 PiB. Storing such a large matrix even on file is not >> possible. >> >> In other words, you need to figure out how to approach your original >> problem in a different way. >> >> /Henrik >> >>

[R] Error because of large dimension

2016-01-24 Thread li li
Hi all, I am doing some calculation with very large dimension. I need to create a matrix with three columns and a very large number of rows (3195*1290*495*35*35*35*15=1.312083e+15) i n order to allocate calculation result from a for loop. R does not allow me to create such a matrix because of

Re: [R] Logical operator in R

2016-01-22 Thread li li
I see. Thanks! 2016-01-22 10:57 GMT-05:00 Rmh <r...@temple.edu>: > FAQ 7.31 > > in this case subtract the two numbers and see that > they differ by about 1e-16 > > Sent from my iPhone > > > On Jan 22, 2016, at 10:46, li li <hannah@gmail.com> wr

[R] Logical operator in R

2016-01-22 Thread li li
Hi all, I encountered the following strange phenomenon. For some reason, the obs_p[1] and res1$st_p[89] have the same value but when I run "==", it returns FALSE. Can anyone help give some explanation on this? Thanks very much! Hanna > obs_p[1] [1] 0.002201438 > res1$st_p[89] [1]

Re: [R] Fwd: exact trend test (enumerate all possible contingency tables with fixed row and column margins)

2016-01-08 Thread li li
As a follow up, I found out the proc freq in SAS can perform the exact permutation trend test. Hanna 2016-01-08 9:30 GMT-05:00 li li <hannah@gmail.com>: > Thanks Bert. > > > 2016-01-07 13:39 GMT-05:00 Bert Gunter <bgunter.4...@gmail.com>: > >> Sorry

[R] permTREND function in package "perm"

2016-01-08 Thread li li
Hi all, I am trying to figure out how to use the function permTREND correctly in package "perm". There does not seem to be any examples given for this function. In the help file, it says the following: ## Default S3 method: permTREND(x, y, alternative = c("two.sided", "less", "greater"), exact

Re: [R] Fwd: exact trend test (enumerate all possible contingency tables with fixed row and column margins)

2016-01-08 Thread li li
t; Subject: Re: [R] exact trend test (enumerate all possible contingency > tables with fixed row and column margins) > To: li li <hannah@gmail.com> > > > I do not know whether there is any package to do what you want. > > I **do** know that the algorithms required to

Re: [R] exact trend test (enumerate all possible contingency tables with fixed row and column margins)

2016-01-07 Thread li li
Dewey <li...@dewey.myzen.co.uk>: > You received a number of suggestions about where to look and packages that > might be suitable. Did you do that? If you did which ones did you look at > and why did you reject them? > > > On 07/01/2016 16:29, li li wrote: > >> Thanks for a

[R] exact trend test

2016-01-06 Thread li li
Hi all, Is there an R function that does exact randomization trend test? For example, consider the 2 by 5 contingency table below: dose0dose 0.15dose 0.5dose 1.5dose 5 row margin Yes 43 4 5 8

Re: [R] Restricted 4-PL curves using drc package

2015-12-10 Thread li li
trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Wed, Dec 9, 2015 at 12:27 PM, li li <hannah@gmail.com> wrote: > > Hi all, > >

Re: [R] change the x axis tickmarks when using plot function in drc package

2015-12-09 Thread li li
Thanks for your help Giorgio! Both options worked. 2015-12-09 11:46 GMT-05:00 Giorgio Garziano : > Looking at the source code of the package drc, there is something that may > somehow explain what > you are experiencing: > > file: plot.drc.R, function addAxes(),

[R] Restricted 4-PL curves using drc package

2015-12-09 Thread li li
Hi all, In drc package, is there a function which can be used to fit restricted 4PL curves? For example, we restrict two 4PL curves have the same lower and upper asymptotes? Thanks for the help in advance! Hanna [[alternative HTML version deleted]]

[R] Error in loading the drc package

2015-12-08 Thread li li
Hi all, When trying to load the drc package. I got the following error. Any suggestions? Thanks. Hanna > install.packages("drc", dependencies=TRUE) --- Please select a CRAN mirror for use in this session --- trying URL 'https://cran.fhcrc.org/bin/windows/contrib/3.1/drc_2.5-12.zip'

Re: [R] [FORGED] Error in loading the drc package

2015-12-08 Thread li li
Thanks. 2015-12-08 15:20 GMT-05:00 Rolf Turner <r.tur...@auckland.ac.nz>: > > Please keep communications on-list. Others may have relevant comments and > suggestions to make. > > > On 09/12/15 09:00, li li wrote: > >> Thanks for the reply. So a newer version of

[R] change the x axis tickmarks when using plot function in drc package

2015-12-08 Thread li li
Hi all, When plotting the dose response curve using plot function as in the example codes below, the scale of the axis should really be on the log scale of the dose given the shape of the graph. But as you can see, the tickmarks of the returned graph represent the original scale. How can I

Re: [R] change the x axis tickmarks when using plot function in drc package

2015-12-08 Thread li li
lot(mod, type="all",log="xy") > > Jim > > > On Wed, Dec 9, 2015 at 1:57 PM, li li <hannah@gmail.com> wrote: > >> Hi all, >> When plotting the dose response curve using plot function as in the >> example codes below, the scale of the ax

Re: [R] question with drm function in "drc package"

2015-12-07 Thread li li
cates so the HTML would not corrupt your code. > > > http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example > -- > Sent from my phone. Please excuse my brevity. > > On December 7, 2015 1:05:32 PM PST, li li <hannah@gmail.com> wr

[R] question with drm function in "drc package"

2015-12-07 Thread li li
Hi all, I am trying to use the drm function in drc package to fit a 4 PL or 3PL curve for an assay response. Please see the listed data below. When I do the curve fitting, it returns the following error message. Anyone who familiar with this have any input on what went wrong? Thanks so much

[R] Plot in drc package

2015-12-07 Thread li li
Hi all, I have the following data and I fit a log logistic model using the drm function in DRC package. I saved the fitted model in an object called "mod". (See below) I understand that we can use the plot function to plot the regression curve with the original data points using the code

Re: [R] [FORGED] Re: correlated binomial random variables

2015-10-08 Thread li li
, and X_2 are both Binomial(n, p). X_0, X_1, and X_2 are all independent. Then X, Y are correlated and P(X <= t, Y <= t) can be exactly calculated. Thanks! Hanna 2015-10-05 18:00 GMT-04:00, Rolf Turner <r.tur...@auckland.ac.nz>: > On 06/10/15 04:43, li li wrote: >>

Re: [R] correlated binomial random variables

2015-10-05 Thread li li
. Say if X is binomial (n, p1) and Y is binomial (n, p2) and the correlation between X and Y is rho and we want to calculate P(X <= c, Y <= c). Thanks so much! Hanna 2015-10-05 11:27 GMT-04:00, li li <hannah@gmail.com>: > > ___

[R] correlated binomial random variables

2015-10-05 Thread li li
__ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

[R] cumulative distribtuion function for multinomial distribution in R

2015-09-28 Thread li li
Hi all, In R, is there a function for the cumulative distribution function for multinomial distribution? I only see pmultinom and rmultinom which are the prabability mass function and the function for generating multinomial random variables respectively. Thanks! Hanna

Re: [R] Order of boxplots

2015-09-15 Thread li li
Thank you! That worked. 2015-09-15 2:50 GMT-04:00 peter dalgaard <pda...@gmail.com>: > > > On 15 Sep 2015, at 04:31 , li li <hannah@gmail.com> wrote: > > > > Hi Jeff, > > Thanks for replying. I actually tried "ordered(tmp$type, levels=c("c

Re: [R] Order of boxplots

2015-09-14 Thread li li
Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > -------

[R] Order of boxplots

2015-09-14 Thread li li
Hi all, I have the following data "tmp" and I want to plot boxplots for each level of the factor "type" and the order the factor should be c, b ,a. In other words, the boxplot corresponding to the level "c" should be the first and so on. Any suggestions? Li > tmp result type 1 101

[R] Adding a second Y axis on a dotplot

2015-09-11 Thread li li
Hi all, I plotted a dotplot based on the data below and code below. I would like to add another yaxis on the right with a different col, different tickmarks and a different label. Can anyone give some help?Thanks very much!! Hanna > tmp1 result lot trt trtsymb trtcol 1 98 lot1

Re: [R] Different random intercepts but same random slope for groups

2015-06-10 Thread li li
for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey 2015-06-09 21:57 GMT+02:00 li li hannah@gmail.com: Hi all, I'd like to fit a random intercept and random slope model. In my data, there are three groups. I want to have

[R] Warning message when using lmer function

2015-06-09 Thread li li
I got the following warning message when using the lmer function. Does anyone know what is the implication? Thanks! Warning message: In anova(model, ddf = lme4) : bytecode version mismatch; using eval __ R-help@r-project.org mailing list -- To

[R] Different random intercepts but same random slope for groups

2015-06-09 Thread li li
Hi all, I'd like to fit a random intercept and random slope model. In my data, there are three groups. I want to have different random intercept for each group but the same random slope effect for all three groups. I used the following R command. However, there seems to be some problem. Any

[R] Confidence interval for the mean in the random intercept and random slople model

2015-06-05 Thread li li
Hi all, I am fitting a random slope and random intercept model usign lme fucntion as shown below. Type is factor with two levels. I would like to to find a confidence interval for mean of this model. Note that the variance we use in finding the confidence interval should include the variariance

Re: [R] How to add legend to a dotplot

2015-06-03 Thread li li
-project.org] On Behalf Of li li Sent: Wednesday, 3 June 2015 13:07 To: r-help Subject: [R] How to add legend to a dotplot Hi all, I wanted to add the legend to a dotplot using legend funciton. If does not seem to be working? Anyone have any suggestions? Thanks! Hanna

[R] How to add legend to a dotplot

2015-06-02 Thread li li
Hi all, I wanted to add the legend to a dotplot using legend funciton. If does not seem to be working? Anyone have any suggestions? Thanks! Hanna __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] lme function to obtain pvalue for fixed effect

2015-05-26 Thread li li
Hi all, I am using the lme function to run a random coefficient model. Please see output (mod1) as below. I need to obtain the pvalue for the fixed effect. As you can see, the pvalues given using the summary function is different from the resutls given in anova function. Why should they be

Re: [R] [R-sig-ME] lme function to obtain pvalue for fixed effect

2015-05-26 Thread li li
desde mi iPhone El 26/5/2015, a las 13:18, li li hannah@gmail.com escribió: Hi all, I am using the lme function to run a random coefficient model. Please see output (mod1) as below. I need to obtain the pvalue for the fixed effect. As you can see, the pvalues given using the summary

[R] different results from lme and lmer function

2015-05-26 Thread li li
Hi all, I am fitting a random slope and random intercept model using R. I used both lme and lmer funciton for the same model. However I got different results as shown below (different variance component estimates and so on). I think that is really confusing. They should produce close results.

[R] dotplot

2015-05-16 Thread li li
Hi all, I wrote the following code and have two questions: (1) As you can see, I would like different colors for different types. It does not come out that way in the graph from this code. Anyone know how to fix this? (2) How do I made the lots number on x axis eligible to read? (3) How

[R] predict function in regression analysis

2015-05-05 Thread li li
Hi all, I have the following data in which there is one factor lot with six levels and one continuous convariate time. I want to fit an Ancova model with common slope and different intercept. So the six lots will have seperate paralell regression lines.I wanted to find the upper 95% confidence

[R] Random effect in ancova model

2015-05-01 Thread li li
Hi all, I have the following data and would like to consider the following model: value = type + batch (type) + beta1* month +beta2*type*month+ error Here type is fixed effect and batch is a random effect neste within type, and month is continuous. Since there is a random effect in this model.

Re: [R] Question with uniroot function

2015-04-16 Thread li li
from my phone. Please excuse my brevity. On April 15, 2015 7:20:04 PM PDT, li li hannah@gmail.com wrote: Hi all, In the following code, I am trying to use uniroot function to solve for the root (a and b in code below) for function f1. I am not sure why uniroot function does not give

Re: [R] Question with uniroot function

2015-04-16 Thread li li
Thank you. 2015-04-16 12:33 GMT-04:00 William Dunlap wdun...@tibco.com: Use optimize() to find the minimum and feed that value into uniroot(). Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Apr 16, 2015 at 7:47 AM, li li hannah@gmail.com wrote: Hi Jeff, Thanks

[R] Question with uniroot function

2015-04-15 Thread li li
Hi all, In the following code, I am trying to use uniroot function to solve for the root (a and b in code below) for function f1. I am not sure why uniroot function does not give the answer since when we look the graph, the function does cross 0 twice. Any suggestion? Thanks. Hanna

[R] Wrong results from anova

2015-04-14 Thread li li
Hi all, I have following data. When I perform an anova, the residual sum of square returns to be zero. But this is wrong, since we can hand calculate the RSS to be around 0.0308. Did anyone come across the same problem before? Any suggestions? Thanks. Hanna ydata Y sample.Y 1

Re: [R] Wrong results from anova

2015-04-14 Thread li li
0.003725088 is the mean square error. 2015-04-14 13:44 GMT-04:00 Michael Dewey li...@dewey.myzen.co.uk: See in-line On 14/04/2015 18:23, li li wrote: Hi all, I have following data. When I perform an anova, the residual sum of square returns to be zero. But this is wrong, since we

[R] xlims of box() function

2015-03-15 Thread li li
Hi all, It looks like the limits for x axis for box function in R is from -1 to 1. How can I change this limit? Thanks for your help. Hanna [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

[R] title of r plots

2015-02-27 Thread li li
Hi all, I would like to add -70°C ± 10°C/Ambient as the title of my plot. Could anyone give some help on this? Thanks. Hanna [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] title of r plots

2015-02-27 Thread li li
=expression(-70*degree*C%+-%10*degree*C/Ambient)) Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Feb 27, 2015 at 7:27 PM, li li hannah@gmail.com wrote: Hi all, I would like to add -70°C ± 10°C/Ambient as the title of my plot. Could anyone give some help on this? Thanks

[R] Finding MLE

2014-11-02 Thread li li
Hi all, I am trying to use the mle function in R to find the maximum likelihood estimator. The ll function below is the negative of the log likelihood. Suppose x0 is the observed values, I want to find the maximum likelihood for a and b. After running the code below, I get the error message

Re: [R] Finding MLE

2014-11-02 Thread li li
, i.e. the start argument for mle. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. Clifford Stoll On Sun, Nov 2, 2014 at 10:36 AM, li li hannah@gmail.com wrote

Re: [R] Finding MLE

2014-11-02 Thread li li
:00 li li hannah@gmail.com: Thanks Bert for the reply. I still get a message when adding the start argument. n - 8 x0 - c(2,3) ll- function(a,b,x=x0,size=n){ + -sum(log(gamma((n-1)/2+a-1)/(gamma((n-1)/2)*gamma(a))*1/(2*b^a)*(x/2)^((n-1)/2-1)*(1/b+x/2)^(-((n-1)/2+a-1} fit

[R] Making several plots using a loop function

2014-06-24 Thread li li
Hi all, When making a bunch of plots using a loop function, how to add title to reflect different plots. Specifically, for the code below, I generated 9 plots. I would like to add a title to each plot. For example, the titles will be respectively, plot1, plot 2, … plot 9. Thank you very

[R] rsm package

2014-02-07 Thread li li
Hi all, I fit a complete second order model for my response with three predictors. However, the lack of fit of the model is still significant. I wish to add the third order terms also. Is there a way to do that using rsm function? Thanks. Hanna [[alternative HTML version

[R] Proportional Odds Model

2013-10-25 Thread li li
Hi all, I am trying to perform an ordinal regression using proportional odds model. First I would like to test whether the assumption of proportional odds is supported by the data. I got the following error message when I try to fit one of the relevant models. Can anyone give some suggestions on

[R] Change color of the boxplot outliers

2013-09-07 Thread li li
Hi all, Is there a way to change the color of the boxplot plots outliers? Thanks. Hanna [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Bayesian Variance Components Estimation

2013-08-01 Thread li li
Hi all, Does anyone know whether there is an R function available to find the Bayesian variance components estimators for random effects or mixed models? Thank you very much. Hanna [[alternative HTML version deleted]] __

[R] How can C++ read the R object written into socket with saveRDS or save

2013-06-25 Thread Rong lI Li
Hi, all, Recently, I met one issue when using socket between R C++ to transmit R object. Would you pls help give me some suggestions? Many thanks! [Background]: I create a socket connection between R C++ binary first, and then, want to use saveRDS() or save() in R to save the object into

  1   2   3   >