Displaying 20 results from an estimated 20000 matches similar to: "format numbers into percentages"
2010 Nov 15
1
Converting numbers to percentages for boxplots
Hi,
I need to convert general numbers to percentages in R to create a boxplot for purposes of comparison.
Can you please tell me how I can do that? My data is attached as a csv file.
Thanks.
Daniel
2008 Apr 04
2
format numbers using 1000 separator
Hi,
Does anyone know how one could format numbers using 1000 separator in R? For
example, format 1000 as 1,000 and 100000 as 100,000, etc.
Thanks,
--
Tom
[[alternative HTML version deleted]]
2010 Jan 12
2
Calculate the percentages of the "numbers" in every column.
Dear friends,
I have a table like this, I have A B C D ... levels, the first column
you see is just the index, and there are different numbers in the
table.
A B C D ...
1 0 2 1 0
2 1 0 2 1
3 2 3 0 0
4 0 0 1 0
5 0 2 3 1
...
I want to calculate the frequencies or the percentages of the numbers
in every column.
How do I get a table like this,
2007 Dec 16
1
format numbers in a contingency table
Hi,
I am constructing a contingency table using xtabs. The function works great:
mo
yr Sep Oct Nov Dec
1950 -7.164486e-02 3.152674e-02 -1.283389e-02 1.570382e-01
1951 3.054293e-02 4.665234e-02 -2.445499e-04 8.720204e-02
1952 3.937034e-02 -4.790636e-02 5.022616e-02 1.180279e-01
but I wonder if there is an argument I can pass to xtabs
2005 Jul 26
4
elegant solution to transform vector into percentages?
Hi,
I am looking for an elegant way to transform a vector into percentages of values
that meet certain criteria.
store<-c(1,1.4,3,1.1,0.3,0.6,4,5)
# now I want to get the precentages of values
# that fall into the categories <=M , >M & <=N , >N
# let
M <-.8
N <- 1.2
# In my real example I have many more of these cutoff-points
# What I did is:
out <- matrix(NA,1,3)
2010 Oct 27
2
Generate random percentages and placing vectors
Hello everyone,
I have two questions:
1.) I would like to generate random percentages that add up to 100. For
example, if I need 5 percentages, I would obtain something like: 20, 30, 40,
5, 5. Is there some way to do this in R?
2.) I would like to insert vectors of specified length into a larger vector
of specified length randomly, and fill the gaps with zeroes. For example, if
I have 3 vectors
2001 Feb 12
1
logistic regression with percentages
Hello
I've got some data and I want to fit a binomial glm. The problem is that I don't have the number of successes or failures, I have only the percentages. If I want to make all these numbers integers, I have to multiply them for 1000, because there are some low percentages (0.05%). Besides, I don't know if this is correct.
Any help?
Thanks in advance, and sorry for my english
2013 Jan 30
1
Percentages in bar plot
Dear R-users,
Though it's a silly thing to ask, but I'm not getting a way out. I wish to
find the percentage distribution for a data vector 'stop'. The coomand
below is giving the frequency distribution. May I know the option to see
the percentages instead of frequencies. Similarly, what option I should
put in a histogram plot to see the percentages instead of frequencies?
2008 Feb 07
5
Row percentages for a table object
I an stumbling on something that is probably very simple, but I cannot
see the solution. I have an object generated by the table () function
and want to recompute this table so each cell represents the
percentage of the corresponding row sum.
Of course a dedicated function can be written (which I have done),
containing the necessary loops etc., but there should be a simpler
way. I'd
2008 Sep 17
3
t-test between percentages
Hi all,
though i know this is a simple question, i really hope someone could.
I am just trying to compare percents respectively the difference in
percents by a simple test. t.test usually compares means and is
working like it is supposed to be. Now i wonder how i can use a test
in R to test for significant difference between two percentages.
2005 Feb 16
2
Sampling given a table of percentages?
I have a vector V. sum(V) = 100, i.e. it's percentages. length(V) is
large. I wish to generate samples (with replacement is fine),
integers, in the range 1:length(V) who's distribution is driven by the
distribution implied by the percentages in V. V is unsorted, but
that could change. I'd rather not be too specific about the
distribution of V. I can certainly solve the
2010 May 14
2
multhist,labels and percentages
Hi All,
I am in the annoying position of having to present some data to someone who seems to be somewhat less than numerate. I need to label the y-axes of a multhist with the y-axis labeled not as counts but as percentage of a population. Plotting the standard histogram is in a way fine, all I need is to:
-- have a left-handside y-axis labels for pop 1 and a right-handside y-axis labels for pop2
2009 May 16
2
Question about barplot: gridlines & value labels
Hello!
I promise I looked into help files before asking. Still cannot figure
it out. I think it's because I am totally confused what packages use
lettice, which use trellis, etc.
Sections 1 and 2 below produce the data and the data to plot. My
question is about barplot in Section 3. I am trying to:
1. add only horizontal gridlines and manipulate the type and color of
that line. tck = 1 is not
2008 Mar 13
4
a more elegant way to get percentages?
Hi,
I am trying to get percentages in a more elegant way. I have a data.frame with locations and values (counts) of species at that location. Each location is repeated for each species i have values for and i would like to get percentages of each species at that location. I am not sure if i am clear in my explanations so i will paste my code below:
#####################
> x
locat val
1
2010 Jan 25
1
sequence of equal-length numbers (for filenames)
Dear R-users,
I'd like to create filenames in a mask "file000.dat" numbered from 1 to e.g.
123. The last problem I'm dealing with is creating the sequence of numbers
with equal length, i.e. 001, 002,.... 023, 024,.... 122, 123.
The closest I got is by a repetition:
Sequence <- c(1:123)
for(i in c(1:length(Sequence))) {
print(
paste(rep("0",
2008 May 23
3
Percentages for categorical data by group
I can think of several ways to blunt force hard code what I want but I
imagine there is a command or two that can be easily combined to do this:
I have a data frame with about 23000 observations. There first variable is
the group to which the observation belongs (about 500 different groups). The
second variable is a response for each observation that is a 1,2,3,4 or 5. I
want to be able to
2008 Jan 24
2
plot help
Hi,
Suppose I already have two plots on the same screen, and I want to draw
lines in each of them. Is that possible in R? It seems that once you have
two plots on the screen, you can only draw lines in the the last plot, never
the 1st. Here is what I mean:
#some data
y1=rnorm(1:3)
y2=rnorm(1:3)
#draw two plots on the same screen
par(mfrow=c(2,1),oma = c(6, 0, 5, 0))
par(mar=c(0, 5.1, 0, 5.1))
2004 Dec 13
3
Percentages in contingency tables *warning trivial question*
I hesitate to post this question in the light of recent threads, indeed
I have hesitated for several weeks, however I have come to a full stop
and really need some help if I am going to progress. I am a new user of
R for medical statistics. I have attempted to read all the relevant
documents, but would welcome any suggestions as to what I have missed.
I am trying to contruct "table 1"
2007 Sep 27
3
Expressing number in percentage
I am wondering if there is any procedure to write a particular value in Percentage format, still maintaining it's numeric character. for example I want to write '.33' as '33%'
regards,
thanks in advance
---------------------------------
[[alternative HTML version deleted]]
Barchart in lattice - wrong order of groups, data labels on top of each other, and a legend question
2009 May 18
1
Barchart in lattice - wrong order of groups, data labels on top of each other, and a legend question
Hello!
I have a question about my lattice barchart that I am trying to build
in Section 3 below. I can't figure out a couple of things:
1. When I look at the dataframe "test" that I am trying to plot, it
looks right to me (the group "Total" is always the first out of 5).
However, in the chart it is the last. Why?
2. How can I make sure the value labels (on y) are not