Re: [R] When to use bootstrap confidence intervals?

2010-08-16 Thread Shentu
Just based on my limited understanding of bootstrapping and statistics in general, bootstrapping is effective but not magical - you can't reasonably expect any reliable inference to be drawn about the population based on a sample of 10, without any distributional assumptions. Your t interval looks

Re: [R] Bootstrap

2010-08-09 Thread Shentu
You should bootstrap the two groups separately. The bootstrap sample you get do not follow the same order as the original sample, so the first 62 observations are coming from both groups. What you bootstrapped is essentially the difference between the pooled mean and itself, which would no doubt

Re: [R] ggplot2 barplot: extra markers in graph

2010-08-04 Thread Shentu
The reason you see the exra markers is that the first part of the command "qplot(DT$N,DT$D,fill=factor(DT$C))" already plots the individual points. You didn't see it with "geom_bar(stat = "identity")" simply because the stacked bars made the previous layer invisible. To see this you can use the gg

[R] Error msg in optim : (list) object cannot be coerced to type 'double'

2010-08-02 Thread Shentu, Yue
Hi all, Thanks to the suggestion from Nikhil to use vector parameters, I have made some progress with my MLE code. I have however encountered another problem with the optimization step. The code is as follows: est.x<-as.vector(tapply(Diff_A1c_6_0,factor(Study_Compound_ID),mean)) ll<- f

[R] Dealing with a lot of parameters in a function

2010-08-02 Thread Shentu, Yue
Hi all, I'm trying to define and log-likelihood function to work with MLE. There will be parameters like mu_i, sigma_i, tau_i, ro_i, for i between 1 to 24. Instead of listing all the parameters, one by one in the function definition, is there a neat way to do it in R ? The example is as follo