similar to: Vectorizing sample()

Displaying 20 results from an estimated 800 matches similar to: "Vectorizing sample()"

2008 Sep 25
2
Two overlaid density plots - Does order matter?
In the following code, the only difference between the two plots is the order the variables are plotted. In this case, the plot of "cdata.den" in plot #1 is different from its plot in #2. Specifically, "cdata.den" spans the x-axis from -5 to 30 in plot #1 and from 0 to 20 in plot #2. Does anyone understand why these two plots do not yield the same result? #Make density
2006 Oct 20
1
understanding virtual classes and extensions thereof
I am having some trouble creating a hierarchy of virtual classes (akin to the class structure in the 'Matrix' package). I think they arise from my not understanding the best way to specify virtual subclasses of a virtual class. please see questions below code. setClass("mom") setClass("kid1", representation("mom", "VIRTUAL"))
2012 Mar 19
2
Reshape from long to wide
Hi, I'm a total beginner in R and this question is probably very simple but I've spent hours reading about it and can't find the answer. I'm trying to reshape a data table from long to wide format. I've tried reshape() and cast() but I get error messages every time and I can't figure why. In my data, I have the length of two fish from each family. My data table (called
2009 Feb 10
1
loglik and arima()
All - I am evaluating an arima(2,1,3) and arima(3,1,3) and notice the log-likelihood of the restricted model is higher than the log-likelihood of the unrestricted. Since these are nested models, I thought the unrestricted model would have a log-likelihood at least as large as that of the restricted model. Am I interpreting the "loglik" output incorrectly? Regards, Stephen
2008 Dec 24
1
Viewing code
How do you view the code for a built-in R command (i.e., if I want to see what R is doing when I run a glm() statement)? Regards, Stephen [[alternative HTML version deleted]]
2008 Jan 29
5
pivot table in R
Hello, I'm struggling with an elementary problem with R. I have a simple data frame such as this one giving the number of accidents subdivided by sex, age and region. sex age region no_of_accidents F young north 10 F young south 12 F old north 5 F old south 7 M young north 24 M
2009 Dec 25
5
[Bug 25795] New: windows not redrawn after resize
http://bugs.freedesktop.org/show_bug.cgi?id=25795 Summary: windows not redrawn after resize Product: xorg Version: 7.4 Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Driver/nouveau AssignedTo: nouveau at lists.freedesktop.org
2008 Nov 28
1
confidence interval for glm
Hi all, simple Q: how do I extract the upper and lower CI for predicted probabilities directly for a glm - I'm sure there's a one line to do it but I can't find it. the predicted values I get with the predict (.. "response") Thanks Gerard ********************************************************************************** The information transmitted is intended only for
2006 Aug 16
3
fitting truncated normal distribution
Hello, I am a new user of R and found the function dtnorm() in the package msm. My problem now is, that it is not possible for me to get the mean and sd out of a sample when I want a left-truncated normal distribution starting at "0". fitdistr(x,dtnorm, start=list(mean=0, sd=1)) returns the error message "Fehler in "[<-"(`*tmp*`, x >= lower & x <= upper,
2009 Jan 27
2
optim() and ARIMA
dhabby wrote: Last week I run in to a lot a problems triyng to fit an ARIMA model to a time series. The problem is that the internal process of the arima function call function "optim" to estimate the model parameters, so far so good... but my data presents a problem with the default method "BFGS" of the optim function, the output error looks like this:
2008 Dec 22
2
queue simulation
Hi all, I have a multiple queing situation I'd like to simulate to get some idea of the distributions - waiting times and allocations etc. Does R has a package available for this - many years ago there used to be a language called "simscript" for discrete event simulation and I was wondering if R has an equivalent (or hopefully with graphics, something better!). Apologies if there
2009 Jan 14
1
loglm fitting
Dear all, sorry to bother you all with this but I've been trying to use the loglm in MASS package (v2.8.0) and cannot get any sensible output. I'm wondering am I doing something very foolish or missing something obvious. For example, I tried the documentation help(loglm) example - here's the code # Case 1: frequencies specified as an array. sapply(minn38,
2008 Dec 26
2
[Bug 19299] New: urxvt does not render fonts with background
http://bugs.freedesktop.org/show_bug.cgi?id=19299 Summary: urxvt does not render fonts with background Product: xorg Version: git Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Driver/nouveau AssignedTo: nouveau at lists.freedesktop.org
2009 May 07
2
Linear least squares fit with errors in both x and y values.
HI, I'd like to perform a weighted linear least squares fit with R on data with varying errors on both vectors. I can do this with one axis using lm, but have no idea where to go from here. I've tried googling, but no idea. Any suggestions? Thanks, James
2009 Jan 13
1
deviance in polr method
Dear all, I've replicated the cheese tasting example on p175 of GLM's by McCullagh and Nelder. This is a 4 treatment (rows) by 9 ordinal response (cols) table. Here's my simple code: #### cheese library(MASS) options(contrasts = c("contr.treatment", "contr.poly")) y = c(0,0, 1, 7, 8,8,19, 8,1, 6,9,12,11, 7,6, 1, 0,0, 1,1, 6, 8,23,7,
2009 Feb 03
1
SAS language to R :interview
Dear List, Please find a frank interview with Phil Rack, creator of Bridge to R ( from both SAS and WPS interfaces). For those unaware of WPS- it is basically a SAS language compiler (read SAS code,writes SAS code,Reads and writes SAS datasets) ,priced at 660 $ a licence ( or estimated 10 times cheaper than Base SAS. The UK based WPC held, WPS doesnt have advanced statistical facilities like
2008 Dec 09
2
for loop query
Hi all, apologies if this is obvious - but I can't see it and would appreciate some quick help! the matrix mhouse is 26x3 and I'm computing odds ratios. The simple code below "should" compute the odds vector for every pair (325) i.e. 26C2 in cols 1 and 2. On the first i=1 outer loop the inner j loop runs from 2 to 26 ok and then I get the error (Error: subscript out of bounds)
2009 Jun 03
2
how can I ordinal regression??
What function and package I use to conduct ordinal regression?? My data is composed 2colums and 180rows. The first colum indicate level of mass and second colum is intensity. So, I want to calculate how much intensity are related mass. [[alternative HTML version deleted]]
2009 Jan 15
1
noise in time series
Hi! I have two time series. Both measure the same thing and I would like to determine which one is noisier. Would it be a good measure of the noise in each time series the absolute lag difference? Is this a good measure? Any other measure I could use? Thanks for help :) David Riano Center for Spatial Technologies and Remote Sensing (CSTARS) University of California 250-N, The Barn One Shields
2009 Mar 23
1
Iterative Proportional Fitting, use
Hi list, I would like to normalize a matrix (two actually for comparison) using iterative proportional fitting. Using ipf() would be the easiest way to do this, however I can't get my head around the use of the function. More specifically, the margins settings... for a matrix: mat <- matrix(c(65,4,22,24,6,81,5,8,0,11,85,19,4,7,3,90),4,4) using fit <-