similar to: Help for Power analysis

Displaying 20 results from an estimated 400 matches similar to: "Help for Power analysis"

2000 Mar 07
3
set_seed
Dear Sir, I would like to set seed in R before this command >B <- 10 >x <- rnorm(15) for (i in 1:B) {boot.sample <- print(sample(x,replace=T)) } ... > for reason of stable of data output. How I do ? Best Regards, Nikom Thanomsieng Department of Biostatistics & Demography, Faculty of Public Health, Khon Kaen University, Thailand.
2010 Sep 08
4
coxph and ordinal variables?
Dear R-help members, Apologies - I am posting on behalf of a colleague, who is a little puzzled as STATA and R seem to be yielding different survival estimates for the same dataset when treating a variable as ordinal. Ordered() is used to represent an ordinal variable) I understand that R's coxph (by default) uses the Efron approximation, whereas STATA uses (by default) the Breslow. but we
2008 Jul 16
5
''$'' placeholder naming can confuse your runner
Hi guys, I''m facing a strange behavior that smells like a bug. consider this scenario: Scenario: I''m cool Given that I am cool 4 times out of 7 and this step: Given("that I am cool $n times out of $n_total") do |n, n_total| ... end When running my story, this step is considered as PENDING. If I change the name of the second placeholder to $total, the step runs
2008 Apr 13
2
Arrays and functions
Hi, I' am doing a stats project using R to work out the size of a t-test and wilcoxon test depending on the distribution and sample size. I just can't get it to work - I want to put my results from the function size() into an array.At the moment I keep getting the error message:Error in res[distribution, test, samplesize] <- results : subscript out of boundsCan anyone tell me where
2005 Nov 09
2
help with legacy R code
Hi there, Could somebody help me disect this legacy R script I inherited at work, I have two questions: 1. I've tried to upgrade our R version from 1.6.2 (yeah, I know), to R 2.0, but some of the lines in this script are not compatible with R 2.0, could someone help me figure out where the problem is? 2. the jpeg generated (attached) seems to be off on some of the data, is there a better way
2009 Sep 18
1
lapply - value changes as parameters to function?
Hi, I'm trying to get better at things like lapply but it still stumps me. I have a function I've written, tested and debugged using individual calls to the function, ala: ResultList5 = DoAvgCalcs(IndexData, Lookback=5, SampleSize=TestSamples , Iterations=TestIterations ) ResultList8 = DoAvgCalcs(IndexData, Lookback=8, SampleSize=TestSamples , Iterations=TestIterations ) ResultList13
2010 Jul 22
1
How do I get rid of list elements where the value is NULL before applying rbind?
Here is the function that makes the data.frames in the list: funweek <- function(df) if (length(df$elapsed_time) > 5) { res = fitdist(df$elapsed_time,"exp") year = df$sale_year[1] sample = df$sale_week[1] mid = df$m_id[1] estimate = res$estimate sd = res$sd samplesize = res$n loglik = res$loglik aic = res$aic bic = res$bic chisq =
2018 Oct 04
2
Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)
Hi Hugo, I've been able to replicate your bug, including for other distributions (runif, rexp, rgamma, etc) which shouldn't be surprising since they're probably all drawing from the same pseudo-random number generator. ?Interestingly, it does not seem to depend on the choice of seed, I am not sure why that is the case. I'll point out first of all that the R-devel mailing list is
2018 Oct 04
2
Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)
Hi Hugo, I've been able to replicate your bug, including for other distributions (runif, rexp, rgamma, etc) which shouldn't be surprising since they're probably all drawing from the same pseudo-random number generator. ?Interestingly, it does not seem to depend on the choice of seed, I am not sure why that is the case. I'll point out first of all that the R-devel mailing list is
1997 Sep 05
2
R-beta: help with R simulation
[[this bounced first, because it has 'help' in the Subject line ... -- Martin Maechler ]] I am a complete novice R programmer. (Though I know C quite well) I am trying to write some R code to do the following simulation. There is a 2-frame "movie" of noise and signal dots. the noise dots have random positions in each frame. The signal dots are placed randomly in frame 1,
2001 Feb 07
3
Goodness of fit to Poisson / NegBinomial
All, I have some data on parasites on apple leaves and want to do a goodness of fit test to a Poisson distribution. This seems to do it: mites <- c(rep(0,70), rep(1,38), rep(2,17), rep(3,10), rep(4,9), rep(5,3), rep(6,2), rep(7,1)) tab <- table(mites) NSU <- length(mites) N <-
2001 Feb 08
2
dnbinom(,size<1,)=0 (PR#842)
This came up on r-help but indicates a bug. dnbinom(x,n,p) calls dbinom_raw(n-1,...) which returns 0 for n<1. -thomas ---------- Forwarded message ---------- Date: Thu, 08 Feb 2001 17:10:23 +0000 From: Yudi Pawitan <yudi@stat.ucc.ie> To: Mark Myatt <mark@myatt.demon.co.uk> Cc: R-Help <r-help@stat.math.ethz.ch> Subject: Re: [R] Goodness of fit to Poisson / NegBinomial
2008 Feb 10
1
Error while using fitdistr() function or goodfit() function
Try changing your method to "ML" and try again. I tried the run the first example from the documentation and it failed with the same error. Changing the estimation method to ML worked. @List: Can anyone else verify the error I got? I literally ran the following two lines interactively from the example for goodfit: dummy <- rnbinom(200, size = 1.5, prob = 0.8) gf <- goodfit(dummy,
2011 Mar 25
1
Appending data to a data.frame and writing a csv
Dear R helpers exposure <- data.frame(id = c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20), ead = c(9483.686,50000,6843.4968,10509.37125,21297.8905,50000,706152.8354, 62670.5625, 687.801995,50641.4875,59227.125,43818.5778,52887.72534,601788.7937, 56813.14859,4012356.056,1419501.179,210853.4743,749961,6599.0862), pd =
2010 Sep 19
1
Weibull- Random Censoring
I generate random vector from Weibull distribution sampWB <-urweibull(sampleSize, shape=shape.true, scale=scale.true, lb=0, ub=Inf) how can I create subvector containing 30% of samplesize of sampWB which should be assigned as Censored data? The probability for each value in sampWB can be uniform to be included in the subvector.
2018 Oct 05
2
Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)
On 05/10/2018, 09:45, "R-help on behalf of hmh" <r-help-bounces at r-project.org on behalf of hugomh at gmx.fr> wrote: Hi, Thanks William for this fast answer, and sorry for sending the 1st mail to r-help instead to r-devel. I noticed that bug while I was simulating many small random walks using c(0,cumsum(rnorm(10))). Then the negative
2010 Aug 11
1
sem & psych
Dear R users, I am trying to simulate some multitrait-multimethod models using the packages sem and psych but whatever I do to deal with models which do not converge I always get stuck and get error messages such as these: "Error in summary.sem(M1) : coefficient covariances cannot be computed" "Error in solve.default(res$hessian) : System ist f?r den Rechner singul?r: reziproke
2009 Aug 12
1
calling a function with dynamically generated buttons
Hallo, I'm dynamically generating buttons depending on the number of rows of my dataframe. Every button is supposed to call a function which generates a plot with the values of one of my dataframe rows. My code looks like this: base <- tktoplevel() plotten <- function(mat, namen, titel) { midpts <- barplot(height=mat, names.arg = namen, main = titel, las=2)
2010 Apr 04
2
"mantel.haenszel.test for trend in S-plus doesn't work i R"
Dear R'ers, When I used S-plus i wrote a small program for a Mantel-Haenszel test for trend (I think it worked). Unfortunately I can't get it working in R. It appears as if my use of 'el' is the problem but I can't sort it out. Error in apply(array, c(, 2, 3), function(el) el * 1:s) : argument is missing, with no default Further down in the program I use 'el'
2001 May 17
1
glm
Hello, I need to fit a generalized linear model with a Chi2 (6 ddl) as error distribution and with "log" as link function. I have looked in help(family) and maybe I could use Gamma(link="log") but I do not know if I can, and where I can define the shape and the scale arguments of the gamma distribution. Maybe there is another may to do that? Could someone explain me how can I