Displaying 20 results from an estimated 30000 matches similar to: "generating a new variable based on results of a by command"
2005 Sep 25
2
getting variable length numerical gradient
Hi all.
I have a numerical function f(x), with x being a vector of generic
size (say k=4), and I wanna take the numerically computed gradient,
using deriv or numericDeriv (or something else).
My difficulties here are that in deriv and numericDeric the function
is passed as an expression, and one have to pass the list of variables
involved as a char vector... So, it's a pure R programming
2005 Jan 19
1
Imputation missing observations
>From Internet I downloaded the file Hmisc.zip and used it for R package updation. and R gave the message 'Hmisc' successfull unpacked.
But when I use the functions like aregImpute the package is displaying coundn't find the function
Where as in help.search it is giving that use of the function
>
2006 Dec 07
2
Splitting a dataframe at the results of tapply
I have got a dataframe containing measurement of aircraft noise like
this:
> Id <- c(1,4,5,2,3,6,4,1,2,5,6,3)
> Noise <- c(88,94,97,98,92,56,103,102,87,95,92,97)
> Height <- c(190, 150, 120, 115, 188, 104, 101, 189, 146, 111, 124,
126)
>
> df <- data.frame(Id, Noise, Height)
Now I would like to split this in two new dataframes. The first one
containing the rows
2006 May 12
3
Maximum likelihood estimate of bivariate vonmises-weibulldistribution
Thanks Dimitris!!! That's much clearer now. Still have a lot of work to
do this weekend to understand every bit but your code will prove very
useful.
Cheers,
Aziz
-----Original Message-----
From: Dimitrios Rizopoulos [mailto:Dimitris.Rizopoulos at med.kuleuven.be]
Sent: May 12, 2006 4:35 PM
To: Chaouch, Aziz
Subject: RE: [R] Maximum likelihood estimate of bivariate
2008 Apr 09
4
apply lm() for all the columns of a matrix
Hi all,
My question is not really urgent. I can write a loop and solve the
problem. But I know that I'll be in a similar situation many more times so
it would be useful to find out the answer
Is there a fast way to perform linear fit to all the columns of a matrix?
(or in the one dimension of a multi-dimensional array.) I'm talking about
many single linear fits, not about a multiple fit.
2006 Mar 02
2
'...' passed to both plot() and legend()
Dear R-devels,
I'd like to create a plot method for a class of objects that passes
the '...' argument to both plot() and legend(), e.g.,
x <- list(data = rnorm(1000))
class(x) <- "foo"
plot.foo <- function(x, legend = FALSE, cx = "topright", cy = NULL,
...){
dx <- sort(x$data)
plot(dx, dnorm(dx), type = "l", ...)
if (legend)
2005 Mar 24
3
summing values by group
At the risk of being wacked for asking what should be obvious....
I have a data frame with one categorical variable "CAT" and several
numeric variables. I want to be able to get simple statistics on the
numeric variables by level. For example, just as you can use table
(CAT) to get the counts, I'd like to be able to get the means and sums
by category.
If someone could point me
2004 Nov 09
3
Strange results for Beta Distribution
Dear All,
I got these results from the example in the function "dbeta":
>x <- seq(0, 1, length=21)
> dbeta(x, 1, 1)
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Any Idea?
TIA
Giovanni
dr. Giovanni Parrinello
Section of Medical Statistics
Department of Biosciences
University of Brescia
25127 Viale Europa, 11
Brescia Italy
Tel: +390303717528
Fax: +390303701157
2005 May 19
2
plot question
hi all:
xlim and ylim are used to define the interval limits of a plot. I'm interested in the scale of values between this limits.
suppose xlim=c(0,10)
we can have e.g.
0 5 10
0 2 4 6 8 10
0 1 2 3 4 5 6 7 8 9 10
which is the parameter that allows me to modify this?
thanks in advance
alexandre
2006 Jun 16
3
Vector Manipulation
I have a vector that has 1,974 elements and each element is one of the
following (B, F, N, Y). How do I recreate that vector accept in the
place of N put 0 and in the place of B, F or Y put a 1?
Thanks,
Jacob
[[alternative HTML version deleted]]
2004 Oct 18
2
why package gregmisc did not work
Dear useR
I want to know why package gregmisc did not work very
well. I did not find this package in my library
directory.
> local({a <- CRAN.packages()
+ install.packages(select.list(a[,1],,TRUE),
.libPaths()[1], available=a, dependencies=TRUE)})
trying URL
`http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length
21630 bytes
2007 May 20
2
Number of NA's in every second column
Hi R-users,
How do I calculate a number of NA's in a row of every second column in my
data frame?
As a starting point:
dfr <- data.frame(sapply(x, function(x) sample(0:x, 6, replace = TRUE)))
dfr[dfr==0] <- NA
So, I would like to count the number of NA in row one, two, three etc. of
columns X1, X3, X5 etc.
Thanks in advance
Lauri
[[alternative HTML version deleted]]
2007 Jan 21
5
Integration + Normal Distribution + Directory Browsing Processing Questions
Hi everyone,
I am new to R, but it's really great and helped me a lot!
But now I have 2 questions. It would be great, if someone can help me:
1. I want to integrate a normal distribution, given a median and sd.
The integrate function works great BUT the first argument has to be a
function
so I do integrate(dnorm,0,1) and it works with standard m. and sd.
But I have the m and sd given.
2005 Jan 21
2
chi-Squared distribution
Dear Rs:
outer(1:3, 1:3, function(df1, df2) qf(0.95, df1, df2))
I compare this F distribution results with the table, the answers were perfect. But I need to see for chi-sqaured distribution. When I employed the similar formula
outer(1:3, 1:3, function(df1, df2) qchisq(0.95, df1, df2)) , I am getting unexpected results. I need to see the following values:
p=0.750 .....
1 1.323
2006 Aug 20
2
how to the p-values or t-values from the lm's results
Dear friends,
After running the lm() model, we can get summary resluts like the
following:
Coefficients:
Estimate Std. Error t value Pr(>|t|)
x1 0.11562 0.10994 1.052 0.2957
x2 -0.13879 0.09674 -1.435 0.1548
x3 0.01051 0.09862 0.107 0.9153
x4 0.14183 0.08471 1.674 0.0975 .
x5 0.18995 0.10482 1.812 0.0732 .
x6 0.24832 0.10059 2.469 0.0154 *
x7
2006 Nov 09
4
Plotting symbols with two positions?
Thanks a lot to Demitris for a prompt answer some minutes ago on another
tread (see below). To avoid excess mails on the list, I move onto next
question:
I have another small plotting problem that confuses me. I want to plot
results from a field trial series, using the numbers of the trials as
symbols in the plot.
pch = as.character(trial_no)
works fine, but truncates the trial number to the
2005 Oct 25
8
Can anyone please tell me how to strip the white spaces from a character vector?
for example:
> a$tic[1:10]
[1] "AIR " "ABCB " "ABXA " "ACMR " "ADCT " "ADEX "
[7] "ABM " "AFCE " "AG " "ATG "
Can anyone please tell me how to strip the white spaces from a$tic?
Thanks,
Roger
[[alternative HTML version deleted]]
2008 Jan 02
2
Multivariate response methods question
Hi Everyone,
I have some data that predicts both a nominal and ordinal response
variable. I was wondering what packages in R would help me analyze the
data?
I was also curious if anyone could recomend me some textbooks that
would help with the analysis of such data? I have the 5th edition of
"Applied Multivariate Statistical Analysis" by Richard A. Johnson and
Dean W. Wichern
2005 Jan 21
2
chi-Squared distribution in Friedman test
Dear R helpers:
Thanks for the previous reply. I am using Friedman racing test. According the the book "Pratical Nonprametric Statistic" by WJ Conover, after computing the statistics, he suggested to use chi-squared or F distribution to accept or reject null hypothesis. After looking into the source code, I found that R uses chi-sqaured distribution as below:
PVAL <-
2007 May 09
2
pvmnorm, error message
Hello there!
My operating system is Windows XP, my version of R is the latest (R-2.5.0). Recently I have downloaded the package "mvtnorm" and a problem with the command "pmvnorm" occured. Trying to enter the lines ...
A <- diag(3)
A[1,2] <-0.5
A[1,3] <- 0.25
A[2,3] <- 0.5
pvmnorm(lower=c(-Inf,-Inf,-Inf), upper=c(2,2,2),mean = c(0,0,0), corr=A)
I got the following