Displaying 20 results from an estimated 20000 matches similar to: "Need help with tables"
2006 Oct 13
3
Need help with barplots
I`ve read all the manuals and still couln`t find what is the difference
between the stacked and side-by-side barplots ? Could you explain me ?
[[alternative HTML version deleted]]
2006 Sep 26
3
Need help with boxplots
How to add a mean line in the boxplot keeping the median line ?
For example in this:
set.seed(1)
a <- rnorm(10)
b <- rnorm(10)
boxplot(a, b)
[[alternative HTML version deleted]]
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 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 :
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)
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]]
2006 Sep 13
2
kendall's w
Hi,
I try to calculate Kendall's W coefficient and I have a bizarre error.
little.app.mat<-matrix(c(1,3,4,2,6,5,2,4,3,1,5,6,3,2,5,1,5,4),nrow=3,byrow=TRUE)
print(kendall.w(little.app.mat[-1,]))
>>> Kendall's W for ordinal data
>>> W = 0.7753623Error in if (is.na(x$p.table)) { : argument is of
length zero
2006 Sep 20
5
multiple lines and plot
Hi. Please, how can I put together 2 or more lines at the same
scatterplot ? Example: measures of protein intake (quantitative) of 4
children over 30 days, by day. How to plot all children at same graphic:
Protein X Time ? Is there any command like "overlay" ?
Thank you,
Mauricio
2006 Sep 14
1
time varying covariates
Hello,
I am trying to model an intensity function with time-varying covariates.
Before, I have successfully defined a log likelihood function for a
Power-Law Process (lambda(t)=alpha*beta*t^(beta-1)) with two paramters
and no covariates for a repairable systems with failure times (t).
This function was maximized with R optim. No problem!
But now I want to include a covariate indicating a
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 24
2
colinearity?
I'm sorry to all those who are tired of seeing my email appear in need of
help. But, I've never coded in any program before, so this has been a
difficult process for me.
Is there a simple function to test for colinearity in R? I'm running a
logistic regression and a linear regression.
Thanks for the help!
[[alternative HTML version deleted]]
2007 Sep 04
2
Table and ftable
Dear listmembers,
I have a little question: I have my data organized as follow
sic level area
a 211 2.4
b 311 2.3
b 322 0.2
b 322 0.5
c 100 3.0
c 100 1.5
c 242 1.5
d 222 0.2
where levels and sics are factors. I'm trying to obtain a matrix like this:
level
211 311 322 100 242 222
sic
a 2.4 0 0
2006 Sep 12
2
(no subject)
Hi,
I have a problem with aggregate.
x <- aggregate(t1,list(t2,t3,t4), mean)
z<-x[,3]
I want z to be a vector but it is a factor.
I've tried to use as.vector(z,mode="numeric") but then the numbers get
scrambeled.
Any help is appriciated
/anders
2006 Oct 24
3
Help with understanding [[]] [] array, list, matrix referencing
Hi all,
I would greatly appreciate some help understanding how R references
arrays, matrices, lists, and objects using [[]] and []. I have read the
R guides and several tutorials but I am not the fastest kid on the block
so I am still having difficulty understanding this. For examples the
following code produces a 5 element list of 2X5 random numbers that I
then convert to a 2X5X5 matrix.
2006 Nov 29
2
need help with barplot
Hello,
I do this
a=c(10.2,0.4,0.2,5.2,8.6,1.6,0.0,1.0,6.3,1.4,0.4,0.2)
b=matrix(a,nrow=4)
rownames(b)=c("20/04/2002","21/04/2002","22/04/2002","23/04/2002")
colnames(b)=c("p1","p2","p3")
barplot(b,beside=T,col=(c("red","orange","yellow")))
then I have
2006 Sep 19
2
bubble plot problems
Hi,
I'm having some problems with a bubble plot (ps package). I don't want
tick marks on all four sides (just two), I want to have a smaller font
size, and I would like to be able to define bubble sizes shown in the
legend (now it shows 0, 0, 0, 9.747 and 4265.757 which is not really
convenient. Passing some of the standard plot arguments didn't help (in
fact, nothing changed).
2007 Jan 20
3
Insert R logo
Dear all R users,
I want to insert the R logo in every graphic that I made in my Statistical
analysis using R. Can anyone tell me whether is it possible or not and if
possible how to do this? your help will be highly appreciated.
Thanks and Regards,
Arun
[[alternative HTML version deleted]]
2006 Sep 27
3
Converting text to numbers
Hi,
I have Forecast Class and Observed Class in a data matrix as below.
> Sample1
FCT OBS
1 1 5
2 2 4
3 3- 3+
4 3 3
5 3+ 3-
6 4 2
7 5 1
I want to find the difference between Observed and Forecast Classes.
How can I get this done?
I tried to following to convert the 1 through 5 classes, to 1 through 7
for both OBS and FCT column.
> Sample1$OBS2 <- Sample1$OBS
2006 Sep 19
3
Reading a file in R
Dear R helpers,
I am trying to read a CSV file in R called EUROPE (originally an Excel
file which I have saved as a CSV file) using the command
EUROPEDATA <- read.csv("EUROPE.csv")
EUROPE.csv is basically a matrix of dimension 440*44, and has a line of
headers, i.e. each column has a name.
Using read.csv I can't load the data into R properly. Although the first
20 columns or
2005 Apr 05
2
cat bailing out in a for loop
Dear All,
I am trying to calculate the Hardy-Weinberg Equilibrium p-value for 42
SNPs. I am using the function HWE.exact from the package "genetics".
In order not to do a lot of coding "by hand", I have a for loop that
goes through each column (each column is one SNP) and gives me the
p.value for HWE.exact. Unfortunately some SNP have reached fixation and
HWE.exact requires a