Displaying 20 results from an estimated 10000 matches similar to: "crosstabulation and unlist function"
2008 Oct 06
1
question on lmList
Hi list,
Using the lmList function from ?nlme package? I get the following error message:
?Error in !unlist(lapply(sum.lst, is.null)) : invalid argument type?
# this is the syntax used
# fm_cream <-lmList(MULTDV~TIME|cod, data=zz, na.action=na.omit)
# summary(fm_cream)
When I generate a simple example the function works, but on the real data I get that message. I imagine that it is a
2010 Jul 13
3
export tables to excel files on multiple sheets with titles for each table
Hello R-users,
Checking the archives, I recently came across this topic:
"export tables to Excel files"
(http://r.789695.n4.nabble.com/export-tables-to-Excel-files-td1565679.html#a1565679),
and the following interesting references have been proposed:
http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows
2008 Oct 03
1
question on xyplot
Hi List,
I have the following problem: I am using the multilevel package and make.univ function for available in the package and then xyplot from lattice and I want to know how could I be able to use the ?coefficient? for the straight line that passes the data ?
Example from help:
library(multilevel)
data(univbct) #a data set already in univariate or stacked form for job satisfaction
2006 Dec 03
2
Force "square" crosstabulation
Hello list members,
I'm looking for a way to force the results of a crosstabulation to be
square - that is, to include 0 values.
For example:
table(letters[1:4],letters[c(1:3,3)])
yields:
a b c
a 1 0 0
b 0 1 0
c 0 0 1
d 0 0 1
I would like to return:
a b c d
a 1 0 0 0
b 0 1 0 0
c 0 0 1 0
d 0 0 1 0
Any suggestions?
Thanks!
--
Manuel A. Morales
2008 Nov 13
2
CROSSTABULATION
I want to form a 3x3 crosstabulation for the signs of two vectors (i.e.
Negative, Zero, Positive). The problem is that I am simulating the data so
for some iterations one of the categories is absent. Thus the resulting
table shrinks to 3x2. I want it to be 3x3 with zero column corresponding to
the missing category. Moreover, I have tried but failed to give the
dimension names.
--
Sohail Chand
2000 Sep 24
2
FW: Crosstabulation
how about this: tapply(vector,list(factor1,factor2),function)?
-----Original Message-----
From: owner-r-help at stat.math.ethz.ch
[mailto:owner-r-help at stat.math.ethz.ch]On Behalf Of Murray Jorgensen
Sent: 24. september 2000 02:46
To: R-help
Subject: [R] Crosstabulation
I can't seem to find a function in R similar to Splus crosstabs() for
creating a multi-way table from factors and a
2010 May 20
2
multiple 2 by 2 crosstabulations?
Hello,
I have a dataframe (var_1, var_2, ..., var_n) and I would like to export summary statistics to Latex in the form of a table. I want specific summary statistics by crossing numerous variables 2x2 AT ONCE. In each cell I would like sometimes to have the median (Q1 - Q3), or frequency and proportion, etc. CrossTable, xtab, etc... do not allow for multiple 2 by 2 crosstabulation. The table
2007 Dec 19
2
4 questions regarding hypothesis testing, survey package, ts on samples, plotting
Good morning!
I have 4 questions which trouble me:
1. I want to test the hypothesis that the 2 proportions (the mean of a binomial) which come from 2 different samples are equal. I want to use the following function
z= (p1-p2)/ sqrt((p1(1-p1)/n1)+(p2(1-p2)/n2)) which is one of the standard formulas for this case. Is there such a function in R?
p1=the proportion from the first sample
n1=the
2008 Jul 14
0
Question regarding lmer vs glmmPQL vs glmm.admb model on a negative binomial distributed dependent variable
Hi R-users,
I intend to apply a mixed model on a set of longitudinal data, with a negative binomial distributed dependent variable, and after following the discussions on R help list I saw that more experienced people recommended using lmer (from lme4 pack), glmmPQL (from MASS) or glmm.admb (from glmmADMB pack)
My first problem: yesterday this syntax was ok, now I get this weird message (I
2008 Jun 15
2
R vs SAS and HLM on multilevel analysis- basic question
Hi R users!
I am trying to learn some multilevel analysis, but unfortunately i am now very confused. The reason: http://www.ats.ucla.edu/stat/hlm/seminars/hlm_mlm/mlm_hlm_seminar.htm
http://www.ats.ucla.edu/stat/sas/seminars/sas_mlm/mlm_sas_seminar.htm
and
MlmSoftRev. pdf from mlmRev package.
>From what i see, the first two links seem to declare the level one variable as a random part (i
2003 May 17
1
how to handle 'multiresponse' variable?
Hello!
I have dataset where one variable is 'multiresponse', like this:
[1] "1 2" "1 2 3" "4" "1 4" "4 3" etc.
'responses' separated by space. observations in different 'rows'
of data.frame.
I can do strsplit(data$var,' ') and make a list, where multiple
responses are elements of character vectors, like this:
$
2012 Mar 15
1
expand.grid using a matrix and a vector as input
Hello R-users,
I have the following question, for which my search did not really return any usable result.
If I have a matrix a1, and a vector a2 like below
a1<-matrix(c(1:4),2,2)
a2<-c(8,9)
is there any function like the expand.grid (or some clever calling of the function) such that it outputs a matrix or dataframe where the entire a1 matrix is repeated for each value of a2 (the
2002 May 23
2
crosstabulation of means
Hello, I am trying to print a crosttabulation of mean,sd,n for a
continuous variable crossclassified by anoother/s grouping variables. I
came up with:
xtab2 <- function(x,g1,g2) {
funy <- function(z)
list(mean(z,na.rm=T),sd(z,na.rm=T),length(z))
aa <- by(x,list(g1,g2),funy)
bb <- matrix(unlist(aa),nrow=3
,dimnames=list(c("mean","sd","n"),
2008 Jun 15
1
multilevel basic lme question
Hi R users
I want to use the lme package for a multilevel analysis on the following example:
> math<-c(2, 3,2, 5, 6 ,7 , 7)
> sex<-c(1, 2, 1, 2, 2, 2, 1)
> school_A<-c(1,1,1,2,2,2,2)
> school_B<-c(10,10,10,20,20,20,20)
> mydata<-data.frame(math, sex, school_A, school_B)
> mydata
School_A and school_B are two different school characteristics, math is an
2008 Dec 22
1
newbie question on tcltk
Hi List,
Can anyone tell me how could i put the "BACK" button in the following code, just under the "AAA" menu? I want this button to go back to the previous page, and since it has nothing to do with the "1" and "2" buttons, i want it somehow separated from these two buttons, but i don't know how. I searched the web for some examples but my results
2002 Jul 12
2
Crosstabs in R
Before I reinvent the wheel, I have need for a relatively straightforward
crosstabulation (2 x n) function. I know that R has table(), ftable(),
xtabs(), and summary(xtabs()), but none of these produce a fully "tricked"
out cross-tabulation with marginal totals, expected cell frequencies, and
an array of statistics about the contingency table.
Is there a more complete (something
2008 Mar 10
2
question for aov and kruskal
Hi R users!
I have the following problem: how appropriate is my aov model under the violation of anova assumptions?
Example:
a<-c(1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,3,3,3,3)
b<-c(101,1010,200,300,400, 202, 121, 234, 55,555,66,76,88,34,239, 30, 40, 50,50,60)
z<-data.frame(a, b)
fligner.test(z$b, factor(z$a))
aov(z$b~factor(z$a))->ll
TukeyHSD(ll)
Now from the aov i found that my model
2009 Jan 31
1
Question on Sweave-Latex and examples in the Sweave Manual
Hi List,
I have a problem with using Latex and Sweave for creating a document.
So I downloaded the Sweave manual from
http://www.statistik.lmu.de/~leisch/Sweave/Sweave-manual.pdf
and i have tried to replicate the example on pages 4-5, but i encounter the following problem: IT DOES NOT WORK. I can run Sweave, create the .tex file and then when building the .tex file in TeXnikCenter i get all
2007 Sep 06
3
Survey package
Good afternoon!
I'm trying to use the Survey package for a stratified sample which has 4 criteria on which the stratification is based. I would like to get the corrected weights and for every element i get a weight of 1
E.g: tipping
design <- svydesign (id=~1, strata= ~regiune + size_loc + age_rec_hhh + size_hh, data= tabel)
and then weights(design)
gives
2003 Aug 22
2
"subscript out of range" message
Hi All:
I was recently working with a dataset on arsenic poisoning. Among the
variables in the dataset, I used the following three variables to produce
crosstabulations (variable names: FOLSTAT, GENDER, ASBIN; all three were
categorical variables, FOLSTAT denoted follow up status for the subjects and
had seven levels, GENDER denoted sex (two levels: male,female), and ASBIN
denoted binarized