Displaying 20 results from an estimated 4000 matches similar to: "Multiple sets of proportion tests"
2017 Nov 24
0
Multiple sets of proportion tests
Hi anonymous,
?prop.test states that it returns a list. And one of the element is
'p.value'. str() on the output of prop.test() reveals that too. So
prop.test()$p.value or prop.test()["p.value"] should work.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR
2017 Nov 24
1
Multiple sets of proportion tests
Thank you for clarifying this point but my main question was about how to modify my code to do the analysis correctly. The code I mentioned :-
MyResults <- apply(Mydata, 2, function(x)prop.test(Mydata,c(200,100))
Results in this error : 'x' and 'n' must have the same length in the prop.test(x,n).
How can I modify "x' or "n" arguments so the analysis
2018 Feb 26
2
glm package - Negative binomial regression model - Error
HI there
I am running this model in negative binomial regression, using glm.
I had no problems with running the model with a set of data, but now that
i'm trying to run if for new one. I always have this same error when
running the regression:
>
> #Run Regression
> x=cbind(factor2ind(d$year),factor2ind(d$month_week))
>
> out<- glm(cbind(influenza, n_sample) ~ x,
2009 Jul 07
4
Test for X=1 fails, test for >0 works, data in text file is 1
Hi,
I am apparently not understanding some nuance about either the use
of subset or more likely my ability to test for a numerical match
using '='. Which is it? Thanks in advance.
I've read a data file, reshaped it and then created MyResults by
keeping only lines where the value column is greater than 0. So far so
good. The data in MyResults looks good to me by eye.
The
2009 Jul 21
4
list of lm() results
How can I get the results of lm() into a list so I can loop through the results?
e.g.
myResults[1] <- lm(...)
myResults[2] <- lm(...)
myResults[3] <- lm(...)
...
myResults[15] <- lm(...)
myResults[16] <- lm(...)
so far every attempt I've tried doesn't work throwing a "number of
items to replace is not a multiple of replacement length" error or
simply not
2018 Feb 26
0
glm package - Negative binomial regression model - Error
Dear Paula,
There are probably missing observations in your data set. Read the
na.action part of the glm help file. na.exclude is most likely what you are
looking for.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg /
2017 Nov 24
2
number to volume weighted distribution
Hi Duncan
I tried Ecdf and/or wtd.quantile from Hmisc and it is working (probably).
Ecdf(x, q=.5)
Ecdf(x, weights=xw,col=2, add=T, q=.5)
wtd.quantile(x)
0% 25% 50% 75% 100%
10 10 10 100 300
wtd.quantile(x, weights=xw, type="i/n")
0% 25% 50% 75% 100%
10.0000 138.8667 192.5778 246.2889 300.0000
But could you please be more specific in this?
>
2017 Nov 18
3
Complicated analysis for huge databases
The loop :
AllMAFs <- list()
for (i in length(SeparatedGroupsofmealsCombs) {
AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) ))
}
gives these errors (I tried this many times and I'm sure I copied it entirely) :-
Error in apply(SeparatedGroupsofmealsCombs[[i]], 2, function(x) maf(tabulate(x + :
object 'i' not found
> }
2017 Nov 18
0
Complicated analysis for huge databases
> On Nov 18, 2017, at 1:52 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote:
>
> Although the loop seems to be formulated correctly I wonder why
> it gives me these errors :
>
> -object 'i' not found
> - unexpected '}' in "}"
You probably did not copy the entire code offered. But we cannot know since you did not "show your code",
2017 Nov 18
2
Complicated analysis for huge databases
Although the loop seems to be formulated correctly I wonder why
it gives me these errors :
-object 'i' not found
- unexpected '}' in "}"
the desired output is expected to be very large as for each dataframe in the list of dataframes I expect to see maf value for each of the 600 columns! and this is only for
for one dataframe in the list .. I have around 150-200
2017 Nov 18
2
Complicated analysis for huge databases
Thanks Boris , this was very helpful but I'm struggling with the last part.
1) I combined the first 2 columns :-
library(tidyr)
SingleMealsCode <-unite(MyData, MealsCombinations, c(MealA, MealB), remove=FALSE)
SingleMealsCode <- SingleMealsCode[,-2]
2) I separated this dataframe into different dataframes based on "MealsCombination"
column so R will recognize each meal
2017 Nov 09
2
Calculating frequencies of multiple values in 200 colomns
Always reply to the list. I am not a free, private consultant!
"For example, if I have the values : 1 , 2 , 3 in each column, applying
Tabulate () would calculate the frequency of 1 and 2 without 3"
Huh??
> x <- sample(1:3,10,TRUE)
> x
[1] 1 3 1 1 1 3 2 3 2 1
> tabulate(x)
[1] 5 2 3
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people
2017 Nov 17
0
Complicated analysis for huge databases
Combine columns 1 and 2 into a column with a single ID like "33.55", "44.66" and use split() on these IDs to break up your dataset. Iterate over the list of data frames split() returns.
B.
> On Nov 17, 2017, at 12:59 PM, Allaisone 1 <allaisone1 at hotmail.com> wrote:
>
>
> Hi all ..,
>
>
> I have a large dataset of around 600,000 rows and 600
2017 Nov 18
0
Complicated analysis for huge databases
On 18/11/2017 4:40 PM, Allaisone 1 wrote:
>
> The loop :
>
>
> AllMAFs <- list()
>
> for (i in length(SeparatedGroupsofmealsCombs) {
> AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) ))
> }
>
>
> gives these errors (I tried this many times and I'm sure I copied it entirely) :-
>
> Error in
2017 Nov 19
1
Complicated analysis for huge databases
Thanks but a new error appeared with the loop :
Error in x + 1 : non-numeric argument to binary operator
I think this can be solved by converting columns (I,II,II,..600) into "numeric" instead of
the current "int" type as shown below in the structure of "33_55" dataframe .
$ 33_55:'data.frame': 256 obs. of 600 variables:
..$ MealsCombinations
2017 Nov 10
0
Calculating frequencies of multiple values in 200 colomns
Thank you for your effort Bert..,
I knew what is the problem now, the values (1,2,3) were only an example. The values I have are 0 , 1, 2 . Tabulate () function seem to ignore calculating the frequency of 0 values and this is my exact problem as the frequency of 0 values should also be calculated for the maf to be calculated correctly.
________________________________
From: Bert Gunter
2017 Nov 10
2
Calculating frequencies of multiple values in 200 colomns
|> x <- sample(0:2, 10, replace = TRUE)
|> x
[1] 1 0 2 1 0 2 2 0 2 1
|> tabulate(x)
[1] 3 4
|> table(x)
x
0 1 2
3 3 4
B.
> On Nov 10, 2017, at 4:32 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote:
>
>
>
> Thank you for your effort Bert..,
>
>
> I knew what is the problem now, the values (1,2,3) were only an example. The values I have are
2012 Jul 13
1
functions of vectors : loop or vectorization
I have a read a lot about the benefits of vectorization in R. I have a
program that takes "almost forever" to run. A good way to see if I have
learned something ... My problem can be summarized like this : I have a
nonlinear function of several variables that I want to optimize over one
letting the other describe a family of curves. In short, I wan't to optimize
f(x,a,b) for several
2009 Jul 08
1
What is cast telling me?
Hi,
What is cast telling me when it says the following?
Aggregation requires fun.aggregate: length used as default
What is 'length'?
I've taken a small subset of data and wondered what EnTime vs
ExTime might look like. cast is kind enough to give me a table but I
don't understand the values in the table. They seem to sum up ro be
the same as the total dimension of the data
2017 Nov 18
0
Complicated analysis for huge databases
Something like the following?
AllMAFs <- list()
for (i in length(SeparatedGroupsofmealsCombs) {
AllMAFs[[i]] <- apply(SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf(tabulate(x+1)))
}
(untested, of course)
Also the solution is a bit generic since I don't know what the output of maf() looks like in your case, and I don't understand why you use tabulate because I would have