Displaying 20 results from an estimated 700 matches similar to: "warning with cut2 function"
2009 Oct 23
1
cut2 once, bin twice...
Hello,
I'm using the Hmisc cut2 function to bin a set of data. It produces bins
that I like with results like this:
[96,270]:171
[69, 96): 54
[49, 69): 40
[35, 49): 28
[28, 35): 14
[24, 28): 8
(Other) : 48
I would like to take a second set of data, and assign it to bins based on
factors defined by my call to cut 2.
Does anyone know how I can do this?
Thank you,
-S
--
View this message
2012 Oct 17
2
cut2 error
To R users,
I am trying to use cut2 function from the 'Hmisc' library. However, when I
try and run the function on the following variable, I get an error message
(displayed below). I suspect it is because of the NA but I have no idea
how to address the error. Many thanks to any insights.
structure(list(var1 = c(97, 97, 98, 98, 97, 99, 97,
98, 99, 98, 99, 98, 98, 97, 97, 98, 99, 98,
2010 Mar 08
1
Help with Hmisc, cut2, split and quantile
Hello,
I have a set of data with two columns: "Target" and "Actual". A
http://n4.nabble.com/file/n1584647/Sample_table.txt Sample_table.txt is
attached but the data looks like this:
Actual Target
-0.125 0.016124906
0.135 0.120799865
... ...
... ...
I want to be able to break the data into tables based on quantiles in the
"Target" column. I can see (using
2011 Apr 13
1
plotting line graphs for output from crosstabs function
Hi R-users,
This is a generic question, is there a way to plot a line graph for the output from crosstable function? one of the inputs to the crosstab function is categorical.
Taby --
[[alternative HTML version deleted]]
2013 Feb 01
2
Nested loop and output help
Hello Everyone,
My name is Thomas and I have been using R for one week. I recently found
your site and have been able to search the archives of posts. This has
given me some great information that has allowed me to craft an initial
design to an inquiry I would like to make into the breakdown of McNemar's
test. I have read an intro to R manual and the posting guides and hope I am
not violating
2006 Apr 25
1
by() and CrossTable()
I am attempting to produce crosstabulations between two variables for
subgroups defined by a third factor variable. I'm using by() and
CrossTable() in package gmodels. I get the printing of the tables first
and then a printing of each level of the INDICES. For example:
library(gmodels)
by(warpbreaks, warpbreaks$tension, function(x){CrossTable(x$wool,
x$breaks > 30,
2009 May 20
1
sem with categorical data
I am trying to run a confirmatory factor analysis using the SEM package. My
data are ordinal. I have read
http://socserv.mcmaster.ca/jfox/Misc/sem/SEM-paper.pdf.
When I apply the hetcor function, I receive the following error:
Error in checkmvArgs(lower = lower, upper = upper, mean = mean, corr = corr,
:
at least one element of 'lower' is larger than 'upper'
Example:
2008 Mar 09
1
question for crosstable
Good evening R-users!
I have the following problem: i want to get a weighted crosstable along with the adjusted standardized residuals test
Example:
a<-c(1,1,1,1,1,2,2,2,3,3)
b<-c(10,10,23,24,33,45,46,70,21,66)
c<-c(3,3,2,3,4,1,1,1,3,3)
d<-c("a", "b","b","c","a","a","a", "b",
2009 Mar 02
1
Cross Tables with odfTable in odfweave
Hi, I've been trying to prepare some crosstables for some survey
questions for a client. I have been using the CrossTable function in the
gmodels package. However, this command only seems to be able to create
CrossTables in text documents.
I've been trying to use odfTable in odfweave to create tables that are
standalone objects in the document that I can then convert to other
2004 Jul 06
3
Improving effeciency - better table()?
Hi,
I've been running some simulations for a while and the performance of R
has been great. However, I've recently changed the code to perform a sort
of chi-square goodness-of-fit test. To get the observed values for each
cell I've been using table() - specifically I've been using cut2 from
Hmisc to divide up the range into a specified number of cells and then
using
2012 Oct 17
2
loop of quartile groups
Greetings R users,
My goal is to generate quartile groups of each variable in my data set. I
would like each experiment to have its designated group added as a
subsequent column. I can accomplish this individually with the following
code:
brks <- with(data_variables,
cut2(var2, g=4))
#I don't want the actual numbers, I need a numbered group
data$test1=factor(brks,
2003 Jan 21
1
bug in CrossTable (package:gregmisc) (PR#2480)
Full_Name: John Hendrickx
Version: 1.6.0
OS: Windows 98
Submission from: (NULL) (137.224.174.216)
CrossTable in the "gregmisc" package fails when the fisher.exact test produces
an error (I suspect this is because the number of cases is too large). This can
be fixed using "FTt <- try(fisher.test(t, alternative = "two.sided"))" or by
making the test optional.
2008 Sep 23
1
Generalising to n-dimensions
Hi R-helpers,
I have two queries relating to generalising to n dimensions:
What I want to do in the first one is generalise the following statement:
expand<-expand.grid(1:x[1],1:x[2],...1:x[n]) where x is a vector of integers
and expand.grid gives every combination of the set of numbers, so for
example, expand.grid(1:2, 1:3) takes 1,2 and 1,2,3 and gives 1,1 2,1
1,2 2,2 1,3 2,3
My x
2009 May 31
1
Bug in gmodels CrossTable()?
Is the code below showing a bug in Crosstable()? My expectation was that
the values produced by xtabs were rounded instead of truncated:
library(gmodels)
abc <- c("a", "a", "b", "b", "c", "c")
def <- c("d", "e", "f", "f", "d", "e")
wgt <- c(0.8, 0.6, 0.4, 0.5, 1.4, 1.3)
2009 Jan 29
1
Question On CrossTable function in gmodels package
Hi R-users,
I have the following problem with CrossTable function within ?gmodels? package: the output of the function (format ?spss? and asresid=T) can not be stored within another object.
For example:
>library(gmodels)
>data(infert, package = "datasets")
> CrossTable(infert$education, infert$induced)->aa # the function prints everything ok on the screen
> aa # works
2008 Aug 03
2
Determining model parameters
This may be a begining question. If so, please bear with me.
If I have some data that based on the historgram and other plots it "looks" like a beta distribution. Is there a function or functions within R to help me determine the model parameters for such a distirbution? Similarily for other "common" distirbutions, Poisson(lambda), Chi-Square(degrees of freedom, chi-square
2008 Oct 01
1
Help with CrossTable
Hi,
I am using the CrossTable function from library(gmodels).
x=unique(data[,c("L1","L1_Revenues","RIC")])
L1_Classification=CrossTable(x$L1,x$L1_Revenues,exclude =
c("NA","","0%","0"),prop.r=FALSE,prop.c=FALSE,prop.t=FALSE,prop.chisq=FA
LSE,dnn=c("L1_Classification","Revenue"))
What I would like
2009 Sep 22
1
cut and re-factor data
Hello R-users,
I have a data frame with a factor of ages in 5 year increments, and various
count data for each age group. I only have this summary information in R at
the moment.
I want to create a new factor that aggregates the age factors if the
existing factors have insufficient counts. Then I can use aggregate to
build a new data set.
I figured out I can get the cut values I want using cut2
2008 Oct 20
4
aggregating along bins and bin-quantiles
Dear all,
I would like to aggregate a data frame (consisting of 2 columns - one
for the bins, say factors, and one for the values) along bins and
quantiles within the bins.
I have tried
aggregate(data.frame$values, list(bin = data.frame
$bin,Quantile=cut2(data.frame$bin,g=10)),sum)
but then the quantiles apply to the population as a whole and not the
individual bins. Upon this
2007 Mar 12
2
altering prefix to multiple variables in different locations within a command file
Hello,
I am seeking advice regarding how I might add the prefix " kc$ " to
variables in a series of commands. The complication is that there is
a large number of variables with different commands. Examples of the
variables in typical commands follow.
It is simple to use search & replace for common variables such as
"group" but I would appreciate advice about whether