Displaying 20 results from an estimated 800 matches similar to: "overleap an iteration within a for-loop when error message produced"
2010 Dec 15
1
pmnorm: probabilites don't sum up to 1
Dear list member,
I struggle with the problem, why the probabilities of choosing one of
three mutually exclusive alternatives don?t sum up to 1!
Let?s assume we have three alternatives X, Y, and Z. Let?s further
assume we know their respective utilities:
uX, uY, uZ. I?m interested in calculating the probability of choosing
X, Y, and Z.
Since I assume that the alternatives are mutually
2011 May 27
0
object not found with %dopar% when using foreach
Dear R-List member,
tried implement the foreach loop. It works fine, when I'm using %do%,
but not when I'm using %dopar%.
I always receive one of the following error messages:
error in { : task 1 failed - "Objekt 'S3' not found" - could the
.export be an solution for this??
Any help is much appreciated!
The Code hast the following structure:
##########
dft3 =
2011 May 27
0
saving multiple arrays from a foreach loop
Dear R-List member,
I have a problem when I'm trying to save two arrays from a foreach-loop.
I'm also not sure whether this is possible or just my inexperience.
However, this works perferctly fine with a for-loop.
Here is an example code - any help is much appreciated!!:
############
n.vpn = 2
n.run= 3
# create to empty matrices
sme = matrix(NA,4,n.vpn)
test = matrix(NA,4,n.vpn)
#
2011 Oct 18
1
Repeat a loop until...
Dear all,
I know there have been various questions posted over the years about loops but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2.
I am generating some data using the multivariate normal distribution (within the 'mnormt' package). [The numerical values of sanad and covmat are not important.]
> datamat <-
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All.
I'd like to generate a sample of n observations from a k dimensional
multivariate normal distribution with a random correlation matrix.
My solution:
The lower (or upper) triangle of the correlation matrix has
n.tri=(d/2)(d+1)-d entries.
Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99)
Populate a triangle of the matrix with the sampled correlations
Mirror the
2008 Feb 19
1
recursive function help
I'm trying to implement a recursive function using integrate, and I
suspect I need a Vectorize somewhere,
but I can't suss it out. Any help would be appreciated. I've tried
traceback() and various debugging ideas to no avail (most likely due to
my inexperience with these tools.)
Here's what I have.
Nk <- function(m, C) {
if (length(m) > 1) {
rho <- C[1, -1]
2009 Mar 25
1
mvtnorm package
Dear all,
I would like to ask information about the package mvtnorm in R.
It is very useful for me the "qmvnorm" comand, but I see that it can
compute only quantile for equicoordinate. Is it possible to have a
curve (or a set of values) if we don't want equicoordinates?
Thank you
Best regards
Antonio.
--
Antonio Lucadamo,
Dipartimento di Scienze Economiche e Metodi Quantitativi
2013 Mar 05
2
Error message
Dear all,
I got an error message when running the following code.
Can anyone give any suggestions on fixing this type of error?
Thank you very much in advance.
Hanna
> integrand <- function(x, rho, a, b, z){
+ x1 <- x[1]
+ x2 <- x[2]
+ Sigma <- matrix(c(1, rho, rho, 1), 2,2)
+ mu <- rep(0,2)
+ f <-
2006 Jun 14
4
write data from function into external table
Dear list,
My apologies if a solution / explanation to this already exists on the list,
but it is difficult to assign it to a certain keyword.
test<-c(1:3)
testfct <- function(x) {test[1]<-100}
test
[1] 1 2 3
testfct(1)
[1] 1 2 3
Basically, I would like to write data into an external table that the function
does not know. Why is this not working / what alternatives exist?
Thanks,
2008 Jun 18
4
Editor for Mac OSX
Dear R-list
I am (forced) to change from Linux to Mac and am now looking for a new editor for R. I would like one that features a split window (console + editor) as well as syntax highlighting. Can anyone help? Especially the split-window feature does not seem to be easily available in the editors desribed on the R-help site, except Emacs, which I am reluctant to start using. I am on a MacBook Air
2008 Jan 07
4
is there something like or() ?
hi, this may be trivial, but we can't seem to find anything adequate,
(although there is a work around with match() ). We are looking for something
along the lines of
plot(table1[table1$var2==or("a","b","c","d"),"var1"])
would be handy, with the potential or() function leading to what
plot(table1[table1$var2=="a" |
2008 Sep 21
1
Calculating interval for conditional/unconditional correlation matrix
Hi there,
Could anyone please help me to understand what should be done in order not to get this error message: Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Here is my code:
determinant<-
function(x){det(matrix(c(1.0,0.2,0.5,0.8,0.2,1.0,0.5,0.6,0.5,0.5,0.5,1.0,x,0.8,0.6,x,1.0),ncol=4,byrow=T))}
matrix<-
2006 Feb 14
2
How to handle large dataframes?
Dear all
I imported a Stata .dta file with the read.dta-function from the
foreign-package. The dataframe's dimensions are
> dim(d.apc)
[1] 15806 1300
Importing needs up to 15 min and calculations with these data are rather
slow (although I subset the data before starting analyses).
My questions are:
1. Has someone experiences importing Stata files (alternatives to
read.dta) ?
2.
2010 Feb 24
1
Remove missing observations
Hi everyone
I have the following problem: My dataframe has 3 variables: ID, Year and
and an outcome variable. The dataframe contains repeated measurements
because the subjects filled out a questionnaire every year. The time span
covers 2 years.
Now I want to check if there is a significant change in the outcome over
the 2 years with a paired wilcox.test. The problem: Not every subject
2009 Sep 14
2
Function "Varcov" in Design (Ver. 2.2-0) package
Hi,
I'm running into an error message for the "anova"-function I never got
before with the Design (Version 2.2-0) package.
There seems to be a missing function "Varcov", please check my
function calls (it's in german but I think you get the error):
> library(Design) ## attaching Design package and dependent packages
Lade n?tiges Paket: Hmisc ## loading
2009 Aug 20
1
Understanding R code
What is
1. par.ests <- optimfit$par
2. fisher <- hessb(negloglik, par.ests, maxvalue=maxima);
3. varcov <- solve(fisher);
4. par.ses <- sqrt(diag(varcov));
Thanks a lot,
fit.GEV <- function(maxima)
{
sigma0 <- sqrt((6. * var(maxima))/pi)
mu0 <- mean(maxima) - 0.57722 * sigma0
xi0 <- 0.1
theta <- c(xi0, mu0, sigma0)
#10/5/2007: removed assign() for maxima.nl
2004 Oct 20
2
common axis label in multiple plot area
Hello
A very short question: Using multiple plots with par(mfrow=c(3,3)), how
can I get R to indicate one common y- and x-axis label? I tried to use
text() in par, but this is then overwritten when I plot the graphs.
--
Sebastian Leuzinger
Institute of Botany, University of Basel
Schönbeinstr. 6 CH-4056 Basel
Ph. 0041 (0) 61 267 3511
fax 0041 (0) 61 2673504
email: Sebastian.Leuzinger@unibas.ch
2018 Mar 22
1
Cannot install broom package
Hello,
I've problems installing several packages in my R on Fedora 27 64 bit. I
found out that it has to do something with a missing compiler
(libgfortran.so.3, see below).
It works if I downgrade the current version of libgfortran to the
specified version by downloading libgfortran-6.2.1-2.fc25.x86_64.rpm and
manually installing it.
However, I don't want to mess up my system,
2005 Jul 28
1
stl()
Hello, anyone got an idea on how to use stl() so that the remainder eventually
becomes white noise? i used stl repeatedly but there is autocorrelation in
the remainder that i can't get rid of.
os: linux suse9.3
------------------------------------------------
Sebastian Leuzinger
Institute of Botany, University of Basel
Sch??nbeinstr. 6 CH-4056 Basel
ph 0041 (0) 61 2673511
fax 0041 (0)
2003 Jul 27
1
multiple imputation with fit.mult.impute in Hmisc
I have always avoided missing data by keeping my distance from
the real world. But I have a student who is doing a study of
real patients. We're trying to test regression models using
multiple imputation. We did the following (roughly):
f <- aregImpute(~ [list of 32 variables, separated by + signs],
n.impute=20, defaultLinear=T, data=t1)
# I read that 20 is better than the default of