similar to: sample function with different proportions

Displaying 20 results from an estimated 10000 matches similar to: "sample function with different proportions"

2011 Jun 26
2
how to extract data from a function printout - example provided
Hi there, Does anyone know how to extract data from a function that prints out two or more summaries? In the function below (the whole code is provided) we get 5 different tables of data. I would like to split each of these tables in a separate file (while the function itself shouldn't be changed), so that further analysis on each data set could be carried out. Your help is deeply
2008 Sep 21
1
Calculating interval for conditional/unconditional correlation matrix
Hi there, Could anyone please help me to understand what should be done in order not to get this error message: Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Here is my code: determinant<- function(x){det(matrix(c(1.0,0.2,0.5,0.8,0.2,1.0,0.5,0.6,0.5,0.5,0.5,1.0,x,0.8,0.6,x,1.0),ncol=4,byrow=T))} matrix<-
2009 Sep 21
1
Three dimensional view of the profiles using 'rgl' package (example of 3 dimensional graphics using rgl package).
Hi there, Anyone has an idea how to put those two sets of code together so that I can get a 3-dimensional picture that includes points instead of 2 separate pictures which doesnt make that much sense at the end. #Let's say that these are the data we would like to plot: A<-c(62,84,53) B<-c(64,82,55) C<-c(56,74,41) D<-c(46,68,38) E<-c(71,98,72) data<-rbind(A,B,C,D,E)
2011 Jul 16
1
MatchIt Package
Hi there dear R users! Anyone knows why does matchit function returns error whenever the "hull" option is used (either "hull.both", "hull.control" or "hull.treat"). Things work well with all the rest of discard options. This is the error msg. >m.out.base <- matchit(formula=f, data=d, method=m, discard="hull.control") [1]
2011 Jun 28
1
extracting data
Let's say I have an original data set which is called A and data extracted from this original data set, called B. Based on these A and B data set I would like to get data set C which includes all the remaining data from the data set A after we exclude data of the data set B. Any idea how to do this? [[alternative HTML version deleted]]
2009 May 18
3
Runtime Error! Keep on happening while using amap, anacor and ca pckg
Hi there dear R users, Does anyone have any idea what the following error means and how to sort it out? Runtime Error! Program: C\Program Files\R\R-2.9.0\bin\Rgui.exe This application has requested the Runtime to terminate it in an unusual way. Please contact the application’s support team for more information. Here is the story: Running the same code, sometimes the error happens and other
2010 Nov 08
2
Sample size calculation for differences between two very small proportions (Fisher's exact test or others)?
Hi, I'm try to compute the minimum sample size needed to have at least an 80% of power, with alpha=0.05. The problem is that empirical proportions are really small: 0.00154 in one case and 0.00234. These are the estimated failure proportion of two medical treatments. Thomas and Conlon (1992) suggested Fisher's exact test and proposed a computational method, which according to their table
2011 Jul 18
1
SDMTools package - calculating overlap?
Dear R users, Any idea of how to calculate an area of an overlap between two functions? The only R build in function that I found is I Similarity Statistic for Quantifying Niche Overlap and I am really not sure if this function is producing exactly what I am interested in since I was plotting functions and often got confused results (for example: got high value for the overlap of one pair and low
2011 Nov 29
3
fill binary matrices with random 1s
Dear all, I am finding difficulty in the following, I would like to create an empty matrix e.g. 10x10 of 0s and sequentially fill this matrix with randomly placed a 1s until it is saturated. Producing 100 matrices of sequentially increasing density., This process needs to be randomized 1000 times., I assume i should run this along the following lines, 1) Create 1000 matrices all zeros, 2) add
2011 Sep 22
2
Proportions of a vector
> > Hi all, > I have a vector xm say: xm = c(1,2,3,4,5,5,5,6,6) > > I want to return a vector with the corresponding probabilities based on the > amount of times the numbers occurred. For example, I should get the > following vector for xm: > prob.xm = c(1/9, 1/9, 1/9, 1/9, 3/9, 3/9, 3/9, 2/9, 2/9) > Using prop.table gives: Usage (with table) > prob.xm <-
2020 Aug 24
2
(sin asunto)
Buenas tardes, tengo una variable bimodal (*var)*, de presencias y ausencias (1s y 0s) y otra variable, *prob*, con las probabilidades que le asigna un modelo (entre 0 y 1). Con: *ggplot(Preds, aes(x=prob, fill= var )) + geom_density(alpha=.3)* obtengo la distribución de las presencias y de las ausencias, por separado, en función del valor de probabilidad asignado. Las dos curvas se cruzan en un
2008 Jun 18
1
How to create strata out of the data.frame table
My data.frame table consist of 3 variables (x,y and z) where each variable has 1000 units. I need to create 5 equal size strata according to one of the variable (let's say x) whereas units of x variable with a higher value have higher probability to be selected in a strata with a higher number (max strata number is 5). I've been trying different things so far and since I am fairly new to
2009 Jun 24
2
Boxplots: side-by-side
Dear R-sians.. I am trying to plot boxplots with side-by-side option.. I tried some of the posted suggestions and could not make it work due to unequal sizes of categories... e.g. weekly measured water depth values are categorized into 5 levels based on their values such measurement is again categorized into dichotomous levels - based on the result of a test I would like generate boxplot of
2008 Oct 20
3
? extended rep()
Hi Folks, I'm wondering if there's a compact way to achieve the following. The "dream" is that, by analogy with rep(c(0,1),times=c(3,4)) # [1] 0 0 0 1 1 1 1 one could write rep(c(0,1),times=c(3,4,5,6)) which would produce # [1] 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 in effect "recycling" x through 'times'. The objective is to produce a vector of
2008 Nov 08
3
Fitting a modified logistic with glm?
Hi all, Where f(x) is a logistic function, I have data that follow: g(x) = f(x)*.5 + .5 How would you suggest I modify the standard glm(..., family='binomial') function to fit this? Here's an example of a clearly ill-advised attempt to simply use the standard glm(..., family='binomial') approach: ######## # First generate some data ######## #define the scale and location of
2004 Sep 01
0
Multiple dependant proportions and sample size
I need to do a sample size calculation to determine the number of audits required. The results of an audit will be: 1) OK 2) Minor variances 3) Multiple variances 4) Severe variances We want to know the sample size required to determine the proportions in each category within say 5% with a confidence of say 80% (specific values to be determined). I have used the test of proportions before but
2004 Sep 01
0
Dependant proportions and sample size
I need to do a sample size calculation to determine the number of audits required. The results of an audit will be: 1) OK 2) Minor variances 3) Multiple variances 4) Severe variances We want to know the sample size required to determine the proportions in each category within say 5% with a confidence of say 80% (specific values to be determined). I have used the test of proportions before but
2023 Apr 09
1
simultaneous confidence intervals for multinomial proportions: sample size
Hello! I want to calculate simultaneous confidence intervals for a nominal variable with three categories: "yes", "no", "partially" and I expect that far more than 5 samples fall into each category. I have read that Glaz & Sison's method is only appropriate for variables with 7 or more categories. Therefore, the Goodman method seems like a good idea. I have
2010 Jul 27
2
Glm
Hi, Is there any way to estimate a DEPENDENT variable through a GLM/LM model? Suppose I have the linear model: y=a0+a1*x1+a2*x2 (a0=1, a1=0.6, a2=0.8, x1~N(1,1), x2~N(0,1)). The alphas and the auxiliary variables are given and I have to estimate y. The point is if I estimate it, let¹s say algebraically, I get high variances that do not decrease as sample sizes increases... Is the any other way
2010 Jul 28
3
how to code it??
Hi I have say a large vector of 3500 digits. Initially the digits are 0s and 1s. I need to check for a rule to change some of the 0s to -1s in this vector. But once I change a 0 to -1 then I need to start applying the rule to change the next 0 only after I see the next 1 in the vector. Say for example x = (0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1) I need to traverse from the 9th element to the last