Displaying 20 results from an estimated 10000 matches similar to: "Function to tell you how an object is put together"
2007 Oct 24
3
multiply for vector in R
Dear All,
Is there a conmand to calculate the multiplication of the elements in a vector? For example:
a=c(1,2,3,4)
I want to get 1*2*3*4=24.
Because the dimension of the vector is high, I want to know there is a command for this task in R?
Thank you so much!
Kang
__________________________________________________
[[alternative HTML version deleted]]
2008 Apr 07
2
tcltk issue remains
Dear R-help,
I'm trying to load the fGarch package and keep running into problems
with tcltk:
After succesfully instaling fGarch (and dependencies) I get:
>library(fGarch)
Loading required package: fBasics
Loading required package: fImport
Loading required package: fSeries
Loading required package: robustbase
Loading required package: fCalendar
Loading required package: MASS
Loading
2005 Mar 22
5
Convert timeseries to transition matrix
Hi All,
Does someone have an idea of how to cleverly convert a categorical
timeseries into a transition matrix?
Ie, I have something like:
x<- c(1,1,2,1,1,2,2,2,1,2),
And I want a matrix with counts and/or probabilities:
> tr <- matrix(c(2,3,2,2),2,2)
> tr
[,1] [,2]
[1,] 2 2
[2,] 3 2
Meaning that there are two transitions from 1 to 1, two from 1 to 2, three
from 2 to 1
2008 Dec 17
1
repeated measures aov with weights
Dear R-help,
I'm facing a problem with defining a repeated measures anova with
weighted data.
Here's the code to reproduce the problem:
# generate some data
seed=11
rtrep <- data.frame(rt=rnorm(100),ti=rep(1:5,20),subj=gl
(20,5,100),we=runif(100))
# model with within factor for subjects/repeated measurements, no
problem
aov(rt~ti + Error(subj/ti),data=rtrep)
#model with weights
2007 Nov 23
2
rbinom with computed probability
Hello,
I have a loop with probability computed from a logistic model like this:
for (i in 1:300){
p[i]<-exp(-0.834+0.002*x[i]+0.023*z[i])/(1+exp(-0.834+0.002*x[i]+0.023
+z[i]))
x and z generated from normal distribution.
I get 300 different probabilities And I want to generate variables from
bernulli distribution
with P for every observation:
T[i]<-rbinom(1,1,p[i])
But i get missing
2008 Apr 10
2
New user, requesting help with MAC installation of R
Hi:
Yesterday I downloaded R and got it up and running on my PC without a
hitch, not so when I tried to do the same on my Mac powerbook, using
Mac OSX: version 10.4.11.. I have virtually no experience, so I
can't tell what exactly went wrong.
At first it appeared that the software loaded correctly, it seemed
like I was able to install R , and I even successfully unpacked
the
2008 Mar 07
1
Re action Time and Time Series Analysis
Dear,
I need to analyse reaction time.
The general idea might be described as this: There are 8x8 circles. My
program light a circle at one time. The subject then click the lighted
circled as fast as possible. After the correct circle is clicked, then the
next circle will be lighted for the subject to click on, and so on.
My questions are:
1. May I use Time Series Analysis? I read that Time
2008 Mar 08
1
R cmd check error reg namespace
Hi,
When running R CMD check I'm getting a number of errors that I don't
quite follow and don't know where to start looking for an answer, any
hints appreciated.
R CMD check trunk
* checking for working latex ... OK
* using log directory '/Users/ivisser/Documents/projects/
depmixProject/depmixNew/rforge/depmix/trunk.Rcheck'
* using R version 2.6.2 (2008-02-08)
* checking
2007 Nov 16
2
creating discretized data
Hi, Ia m working in discretized data. Here my data:
x <- c(2,1,3, 5), and I want to make (0,1) data based on the length of
each component in x.
So the new data should like: y = (0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1). I spent
too much time with
"seq", "rep". Still didn't get it. Any help? Thanks
Ilham
[[alternative HTML version deleted]]
2008 May 09
2
K-Means Clustering
Hello,
I am hoping you can help me with a question concerning kmeans clustering
in R. I am working with the following data-set (abbreviated):
BMW Ford Infiniti Jeep Lexus Chrysler Mercedes Saab Porsche
Volvo
[1,] 6 8 2 8 4 5 4 4 7 7
[2,] 8 7 4 6 4 1 6 7 8 5
[3,] 8 2 4
2007 Nov 06
4
C++ and R interface
Hi All,
I am trying to do an ML estimation in R. My likelihood function has
several nested loops and so it takes a lot of time (days when I use the
genetic algorithm for optimization) for the optimization to finish.
Unable to avoid loops, I am thinking of writing the likelihood function
in C++ and calling it from within R when using *optim()*. I found that
one can call C functions (once they have
2007 Nov 28
4
Replacing values job
Hallo,
I have two vectors of different lengths which contain the same set of
values:
X < -c(2,6,1,7,4,3,5)
Y <- c(1,1,6,4,6,1,4,1,2,3,6,6,1,2,4,4,5,4,1,7,6,6,4,4,7,1,2)
How can I replace the values in Y with the index (!) of the corresponding
values in X. So 2 appears in X in the first coordinate, so all 2’s in Y
should be replaced by 1, etc.
Thank you for your help,
Serguei
2008 Nov 09
1
choice of an HMM package
We are trying to build a human respiration model.
Preliminary analysis of some breathing signals has shown that humans breathe
through switching among
a finite number of patterns.
Hidden Markov seems to be the right approach. Since most of our code is
written in R scripting language, finding an R package implementing an HMM
that we can use for our prototype would be very helpful.
I have been
2005 Sep 26
1
hidden markov models
Dear R community,
I am looking for an R package or other software to study hidden
Markov models. I need to be able to incorporate multivariate
emissions and covariates for the transition probabilities. The msm
package seems almost perfect for my purpose, but I do not think it
allows multivariate emissions.
I will be grateful for your suggestions.
All the best,
--
Emilio A. Laca
One
2005 Jul 03
1
code for model-averaging by Akaike weights
Dear all,
does anyone have r code to perform model-averaging of regression
parameters by Akaike weights,
and/or to do all-possible-subsets lm modelling that reports parameter
estimates, AICc and number of parameters for each model?
I have been looking for these in the archive but found none.
(I am aware that many of you would warn me against these methods
advocated by Burnham and Anderson
2005 May 06
2
bivariate normal cdf
-- R Help List --
I am looking for a bivariate normal cdf routine in R. I have some fortran routines for this, which appear to be based on 15-point quadrature. Any guidance/suggestions on making these in loadable R-functions would be appreciated.
Thanks,
Dan
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Daniel A. Powers, Ph.D.
Department of Sociology
University of Texas at Austin
2007 Jun 26
2
fisher information matrix
Hi All,
a colleague wants to calculate the Fisher information matrix for a model he
wrote (not in R). He can easily get the neg-log-likelihood and the best fit
parameters at the minimum. He can also get negLLs for other parameter values too.
Given these data, is there a way in R to calculate the Fisher information matrix?
Best,
Federico
--
Federico C. F. Calboli
Department of Epidemiology
2007 Jul 17
3
logical operators priority
Dear R-users,
I haven?t found rules for logical operators. I need to select data according
the following rule:
Condition A & (Condition B | Condition C) How should I write it?? Is
Condition A & Condition B | Condition C correct or will R execute (Condition
A & Condition B) | Condition C ?
Thanks for your help.
Delphine Fontaine
Delphine Fontaine
Statistician
Statistics
2008 Nov 11
1
R: R: Hidden Markov Models
Thank you for your prompt answer.
The breathing signal observations are the amplitude values as a function of time and phase.
According to our model the hidden states are the different breathing types.
Subjects, whose respiratiion process is regular, are likely to breathe, keeping the same cycle pattern/type,
for many consecutive cycles. therefore dwelling in the same hidden state.
The more
2008 Apr 22
3
how to read in multiple files with unequal number of columns
Dear all,
I want to read in 1000 files which contain varying number of columns.
For example:
file[1] contains 8 columns (mixture of characters and numbers)
file[2] contains 16 columns etc
I'm reading everything into one big data frame and when I try rbind, R
returns an error of
"Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match"
Below is my