Displaying 20 results from an estimated 800 matches similar to: ""xtable" results doesn't correspond to data.frame"
2005 Mar 23
4
sampling from a mixture distribution
Dear R users,
I would like to sample from a mixture distribution p1*f(x1)+p2*f(x2). I
usually sample variates from both distributions and weight them with their
respective probabilities, but someone told me that was wrong. What is the
correct way?
Vumani
2004 Mar 25
3
subsetting based on vector
Dear R users;
I am trying to write a small program which reads in a data set, and selects
observations from certain years before the analysis. I have a problem
including the selection criteria in the header of the program.
Here is the problem;
dataFIT<-function(MODEL, MARGINS, yearConsidered){
library(foreign
CovPaper<-read.spss("C:/Data/data.sav")
NewData <-
2005 Aug 04
2
drawing a network digraph
Dear R users,
I have a matrix with 2 columns with the variables: "daughter index", "mother
index". I would like to draw a network digraph using this data, where each
daughter is connected to a mother and between the connections inlcude a
circle with the information on the indices ("daughter index", "mother
index"): i.e. something similar to graphs
2006 Mar 08
2
fitting a distribution using glm
it is easy to fit a distribution using fitdistr
poisdata <- rpois(n = 100, lambda = 2)
poismle <- fitdistr(poisdata, "Poisson")
poismle
but i would like to know whether its possible to get an identical result
using glm. I use
poistab <- data.frame(table(poisdata))
colnames(poistab) <- c("width","freq");
poistab[,"width"] <-
2003 Jan 22
1
something wrong when using pspline in clogit?
Dear R users:
I am not entirely convinced that clogit gives me the correct result when I
use pspline() and maybe you could help correct me here.
When I add a constant to my covariate I expect only the intercept to change,
but not the coefficients. This is true (in clogit) when I assume a linear in
the logit model, but the same does not happen when I use pspline().
If I did something similar
2003 Jun 16
1
Hmisc multiple imputation functions
Dear all;
I am trying to use HMISC imputation function to perform multiple imputations
on my data and I keep on getting errors for the code given in the help
files.
When using "aregImpute" the error is;
>f <- aregImpute(~y + x1 + x2 + x3, n.impute=100)
Loading required package: acepack
Iteration:1 Error in .Fortran("wclosepw", as.double(w), as.double(x),
2004 May 27
2
manipulating elements of a vector
Dear R users;
I would like to convert a series of vectors to matrices in the following
way;
(2,1,1) to a matrix
1 0 0
1 0 0
0 1 0
0 0 1
The idea is that the column sum of the matrix should be equal to the
elements of the vector.
Thanks.
Vumani
2003 Jan 17
2
Re: Universal legend in plot
Dear R-users:
I asked a question on how I can have a universal legend in a plot and
received the following result. I tried using "layout" but I can't seem to
work on the "empty" plot (where I have to have the legend). I tried "oma"
but I couldn't improve the quality of the plot, and that I didn't know how
to specify all the line types using the
2003 May 09
1
manipulating elements of a matrix
Dear R users:
I have the following matrix.
0 1 1
0 1 0
2 1 0
3 0 0
I would like to spread the matrix such that whenever the row sum is greater
than 1 the row is repeated the number of times given by the row sum.
Furthermore I would like to split the following cases:
0 1 1
such that it map to the following matrix
0 1 0
0 0 1
such that each row adds up to 1.
I have no problems with cases
2005 Nov 21
2
Multinomial Nested Logit package in R?
Dear R-Help,
I'm hoping to find a Multinomial Nested Logit package in R. It would
be great to find something analogous to "PROC MDC" in SAS:
> The MDC (Multinomial Discrete Choice) procedure analyzes models
> where the
> choice set consists of multiple alternatives. This procedure
> supports conditional logit,
> mixed logit, heteroscedastic extreme value,
2005 Jun 01
1
"\n" in legend using substitute and as.expression
Dear R users,
Is it possible to force a hard return in an expression. I tried including
one for a legend using an expression and it didn't work. Here is my code,
legend(12, 0.10, c("Fitted density",
as.expression(substitute(paste("Weibull (", alpha==shapeU," , ",
beta==scaleU,") Mean = ",meanU," days"),
list(shapeU =
2003 Jan 20
1
R analogue
Dear R users:
Is there any R analogue for the S+ function "na.gam.replace". I would like
to make an interaction of a categorical and smooth continuous covariate.
Thanks.
Vumani Dlamini
Central Statistical Office
Swaziland
2006 Jun 29
1
using "rbinom" in C code gives me erroneous results... random variable is not random (always zero)...
Dear Listers,
I am trying to use "rbinom" in my C code, but i always get zeros as output no matter the probability. Am not sure what I am doing wrong because the function has worked before. Attached in an example. Noticed that "rbinom" expects 'n' to be REAL.
Regards, Vumani
R 2.3.1 (2006-06-01)
Windows XP
Gcc
/* Called this file binom.c and then ran rcmd shlib on it
2006 Jul 05
1
i suspect that there a memory leak in "vmmin"?
Dear listers,
Am currently using MCMC approaches to estimate some parameters of my model.
One parameter has to be updated using a tuned gamma distribution. So at each
iteration I estimate the mean and variance of the density of the gamma
approximation using "vmmin" (i also supply the gradient argument). For
moderate replications the procedure works, but if I increase them R crashes.
2003 Aug 20
1
query on converting survey data from one structure to another
Dear R users,
I am trying to convert a dataset from one format to several rectangular
datasets. A consultant helped design the data entry program for our survey
using Delphi/Pascal and for each household the information is stored in a
file called "EA-HM-HH.TXT" where EA is the enumeration area number, HM is
the homestead number and HH is the household number. Within this file the
2011 Oct 28
1
xtable with \begin{tabular} and only.contents
I have found that I like having my captions and labels in my latex document
rather than having them contained in my xtable output file (I haven't fully
gone to sweave yet). I know I can do something like this by using the
'only.contents' argument in xtable. Unfortunately, the only.contents
argument also removes the \begin{tabular}{rrrrrr} & \end{tabular} (in the
example below) of
2013 May 24
2
xtable() with booktabs option problem
I could have sworn that yesterday xtable(file, booktabs = TRUE) was giving me toprule , midrule and bottomrule outout. Today :
library(xtable)
aa <- table( sample(letters[1:9], 100, replace = TRUE))
xtable(aa,
booktabs = TRUE)
gives me
\begin{table}[ht]
\centering
\begin{tabular}{rr}
\hline
& V1 \\
\hline
a & 15 \\
b & 11 \\
c & 13 \\
d &
2010 Nov 22
1
Problem setting the number of digits in xtable
DEar list members,
I am currently using Sweave with LaTeX which is great.
I can use xtable for formatting outp of tables but I have a problem setting the number of decimals in xtables when used with dataframe.
I have found an example on the net ith matrix and it works.
For example this works :
> > tmp <- matrix(rnorm(9), 3, 3)
> > xtmp <- xtable(tmp)
> > digits(xtmp)
2008 Sep 24
1
paste in xtable
Dear R help:
I am trying to use paste(), within an ifelse() statement to insert latex
commands into an object that has been created using xtable(). I cannot
make the strings behave as I would like, the '\t' is creating a tab, the
usual method of '\\t' is not working either - nor is any series of
backslashes. The xtable object, I think, automatically alters the
strings. How
2008 Jul 03
1
*** significance with xtable
Hello everybody,
i used xtable to get some latex output, which worked pretty well with
my latex document. But somewhere i missed the part where they explain
how to get these nice significance indicating *** into my latex
table. it just stops right after Pr(> |t|)
thanks in advance
matthias