Displaying 20 results from an estimated 30000 matches similar to: "extract a value from vector"
2006 Sep 20
2
Poission distribution
The expected number of bladder cancer over next 20 years a tire
industry is 1.8. Poission distribution is assumed to hold and 6
reported deaths are caused by bladder cancer among the employees.
Trying to find how unusual this event is.
> ppois(q=6, lambda=1.8, lower.tail = TRUE, log.p = FALSE)
[1] 0.9974306
not sure if ppois is the right one to use and the parameters...
thx much
2006 Oct 19
5
binom.test
R-experts:
A quick question, please.
>From a lab exp, I got 12 positives out of 50.
To get 90% CI for this , I think binom.test might be the one to be used.
Is there a better way or function to calculate this?
> binom.test(x=12, n=50, p=12/50, conf.level = 0.90)
Exact binomial test
data: 12 and 50
number of successes = 12, number of trials = 50, p-value = 1
alternative
2006 Oct 27
3
Power of test
What would be the R formulae for a two-sided test?
I have a formula for a one-sided test:
powertest <- function(a,m0,m1,n,s){
t1 = -qnorm(1-a)
num = abs(m0-m1) * sqrt(n)
t2 = num/s
pow = pnorm(t1 + t2)
}
Would you pls let me know if you know of?
Thank you,
ej
2006 Dec 03
4
prop.trend.test issue
I have the clinical study data.
Year 0 Year 3
Retinol (nmol/L) N Mean +-sd Mean +-sd
Vitamin A group 73 1.89+-0.36 2.06+-0.53
Trace group 57 1.83+-0.31 1.78+-0.30
where N is the number of male for the clinical study.
I want to test if the mean serum retinol has increased over 3 years
among subjects in the vitamin A group.
> 1.89+0.36
2006 Oct 19
1
Re : CI
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20061019/dc66a793/attachment.ksh
2006 Sep 10
2
rownumber
# R 2.3.1
I read the data set into R, but the data set have two rows per record.
i.e.
.........
105 1 1 1103 1 5 4 8 5 22
105 2 2 2 2 1 2 17 16 26
106 1 2 606 1 5 12 11 9 37
106 2 2 2 2 2 2 16 14 29
2006 Sep 11
9
rename cols
A quick question please!
How do you rename column names? i.e. V1 --> Apple; V2 --> Orange, etc.
thx much
ej
[[alternative HTML version deleted]]
2006 Oct 19
1
CI
I have a quick question, please.
Does R have function to compute i.e. a 90% confidence interval for the
mean for these numbers?
> mean (6,11,5,14,30,11,17,3,9,3,8,8)
[1] 6
I thought pt or qt would give me the interval, but it seems not.
thx much.
ej
2006 Dec 09
1
Error in rmultinom(n, size, prob) : too few positive probabilities
// R 2.3.1
Can someone please explain why this error returns?
> y=numeric(100)
> x=matrix(runif(16),4,4)
> for(i in 2:100)
+ {
+ y[i]=which(rmultinom(1, size = 1, prob = x[y[i-1], ])==1)
+ }
Error in rmultinom(n, size, prob) : too few positive probabilities
thx much
ej
2006 Dec 11
1
similarity test with R
>x=c(3.05176E-05,0.000457764,0.003204346,0.0138855,0.04165649,0.09164429,0.1527405,0.1963806,0.1963806,0.1527405,0.09164429,0.04165649,0.0138855,0.003204346,0.000457764,3.05176E-05)
>y=c(0.0000306,0.0004566,0.0031985,0.0139083,0.0415539,0.0917678,0.1528134,0.1962831,0.1962994,0.1527996,0.0917336,0.0415497,0.0139308,0.0031917,0.0004529,0.0000301)
I tried chisq.test, t-test, prop.test, etc,
2006 Dec 09
7
Simulation with R
An apparatus exists whereby a collection of balls is displaced to the
top of a stack by suction. A top level (Level 1) each ball is shifted
1 unit to the left or 1 unit to the right at random with equal
probability. The ball then drops down to level 2. At Level 2, each
ball is again shifted 1 unit to the left or 1 unit to the right at
random. The process continues for 15 levels and the balls are
2006 Sep 15
2
prediction interval for new value
Hi,
1. How do I construct 95% prediction interval for new x values, for example - x = 30000?
2. How do I construct 95% confidence interval?
my dataframe is as follows :
>dt
structure(list(y = c(26100000,
60500000, 16200000, 30700000, 70100000, 57700000, 46700000, 8600000,
10000000, 61800000, 30200000, 52200000, 71900000, 55000000, 12700000
), x = c(108000, 136000,
2006 Dec 02
1
Chi-squared approximation may be incorrect in: chisq.test(x)
I am getting "Chi-squared approximation may be incorrect in:
chisq.test(x)" with the data bleow.
Frequency distribution of number of male offspring in families of size 5.
Number of Male Offspring N
0 518
1 2245
2 4621
3 4753
4 2476
5
2006 Oct 19
2
How to get multiple Correlation Coefficients
Hi
I have used a polycor package for categorical correlation coefficients.
I run the following script. But there were no results.
Could you tell me how to correct the script?
Thanks in advance,
vars <- names(sdi)
for (i in 1:length(vars)) {
for (j in 1:length(vars)) {
paste(vars[i]," and ", vars[j])
polychor(vars[i], vars[j])
# corr
}
}
--
Kum-Hoe Hwang, Ph.D.Phone :
2007 Feb 09
1
extract submatrix with unique names
Dear list,
I have a table where first 3 columns are identical if the name in the
first column is the same, and
the number in N4 is slightly different for all identical names, like
this:
-------------------------------------------------------------------
29 Mm.1_at 3 + 93649936
30 Mm.1_at 3 + 93649990
31 Mm.1_at 3 + 93649993
32
2006 Oct 19
1
extract arguments from a list
Hi,
I would like to know how to extract the arguments from a list :
For example, I have a list of charchacter x
x<-
c("Bentazone","Atrazine","Epoxiconazol","Metolachlor","Epoxiconazol","Atrazine
desethyl","Fenpropimorph","Epoxiconazol","Metolachlor","Simazine","Atrazine
2006 Oct 02
3
line plot through NA
Dear R-help list,
I hope I did not miss something obvious, because my question seems very
simple, but I couln't figure out how to do it.
If I have the following data:
Day<-c(1,2,3,4,5,6,7)
V<-c(5,NA,10,30,45,NA,10)
than the line in plot
plot(V~Day, type="b")
will start with the 3rd value and stop stop at the 5th value because all NA
are omitted. Is there now a parameter
2006 Nov 29
2
Dummies multiplied with other variable
Hi,
I would like to estimate something like y = a + b*d2*y + c*d3*y where
the dummies are created from some vector d with three (actually many
more) levels using factor(). But either there is included the variable
y or d1*y. How could I get rid of these?
Example:
x = c(1,2,3,4,5,6,7,8)
y = c(3,6,2,8,7,6,2,4)
d = c(1,1,1,2,3,2,3,3)
fd = factor(d)
lm(x ~ fd*y)
gives:
Coefficients:
(Intercept)
2007 Dec 18
1
How can I extract the AIC score from a mixed model object produced using lmer?
I am running a series of candidate mixed models using lmer (package lme4)
and I'd like to be able to compile a list of the AIC scores for those
models so that I can quickly summarize and rank the models by AIC. When I
do logistic regression, I can easily generate this kind of list by creating
the model objects using glm, and doing:
> md <- c("md1.lr", "md2.lr",
2006 Sep 15
2
missing data codes
Dear all,
I am new to R. I wish to use R's multiple imputation to deal with missing
data. I have a data set with the size around 300 observations and 150
variables. I checked the help function in R and could not locate how to
write the codes for this. can anyone give a hand?
Do appreciate your time and kindness!
Q.
[[alternative HTML version deleted]]