Displaying 10 results from an estimated 10 matches for "tbl2".
Did you mean:
tbl
2018 Feb 03
2
find unique and summerize
Thank you so much Rui.
1. How do I export this table to excel file?
I used this
tbl1 <- table(Country, IDNum)
tbl2=addmargins(tbl1)
write.xlsx(tbl2,"tt1.xlsx"),sheetName="summary", row.names=FALSE)
The above did not give me that table.
2. I want select those unique Ids that do have records in all countries.
From the above data set, this ID "FIN1540166" should be excluded...
2018 Feb 05
0
find unique and summerize
...<ruipbarradas at sapo.pt
>> <mailto:ruipbarradas at sapo.pt>> wrote:
>>
>> Hello,
>>
>> As for the first question, instead of writing a xlsx file, maybe it
>> is easier to write a csv file and then open it with Excel.
>>
>> tbl2 <- addmargins(tbl1)
>> write.csv(tbl2, "tt1.csv")
>>
>> As for the second question, the following does it.
>>
>> inx <- apply(tbl1, 1, function(x) all(x != 0))
>> tbl1b <- addmargins(tbl1[inx, ])
>> tbl1b
>>
>...
2018 Feb 03
0
find unique and summerize
Hello,
Thanks for the reproducible example.
See if the following does what you want.
IDNum <- sub("^(\\d+).*", "\\1", mydata$ID)
Country <- sub("^\\d+(.*)", "\\1", mydata$ID)
tbl1 <- table(Country, IDNum)
addmargins(tbl1)
tbl2 <- xtabs(Y ~ Country + IDNum, mydata)
addmargins(tbl2)
Hope this helps,
Rui Barradas
On 2/3/2018 3:00 AM, Val wrote:
> Hi all,
>
> I have a data set need to be summarized by unique ID (count and sum of a
> variable)
> A unique individual ID (country name Abbreviation follo...
2018 Feb 03
2
find unique and summerize
Hi all,
I have a data set need to be summarized by unique ID (count and sum of a
variable)
A unique individual ID (country name Abbreviation followed by an integer
numbers) may have observation in several countries. Then the ID was
changed by adding the country code as a prefix and new ID was constructed
or recorded like (country code, + the original unique ID Example
original ID
2009 Dec 09
1
reshape() makes R run out of memory (PR#14121)
...ansform it into the following data frame ("wide" transpose) based on
common ID and DATEs:
ID DATE1 DATE2 VALUE.TYPE1 VALUE.TYPE2
'abcd1233' 2009-11-12 2009-12-23 123.45 NA
...
Using stock reshape() as follows:
tbl2 <- reshape(tbl, direction = "wide", idvar = c("ID", "DATE1", "DATE2"),
timevar = "VALUE_TYPE");
On a toy data frame this works fine. On a real one with 4.7 million entries
(although about 70% of VALUEs are NA) it runs out of memory:
Error:...
2010 Aug 29
1
Finding functions of large dataset for numerical integration
Hello everyone,
I have been trying to figure out away to integrate under a spline produced
by the package tps(fields). As the package does not output functions I am
trying to do something similar to the trapezium rule. My data are 3D (x, y &
z). I have extracted from the surface output by Tps the values of z at
regular intervals so that I have a grid of figures, for example:
1 4 6 6 8
8
2012 Aug 31
2
test Breslow-Day for svytable??
Hi all,
I want to know how to perform the test Breslow-Day test for homogeneity of
odds ratios (OR) stratified for svytable. This test is obtained with the following code:
epi.2by2 (dat = daty, method = "case.control" conf.level = 0.95,
units = 100, homogeneity = "breslow.day", verbose = TRUE)
where "daty" is the object type table svytable consider it, but
2010 Feb 21
1
odfWeave - merged table cells, and adding information like totals and p-values
...e by hand. But I'm trying to be smart and use odfWeave. Now I know I can put them in my caption but I'd probably have added them as an extra row in my table or added it in brackets similar to the SDs/ORs and CIs shown in this example http://www.bmj.com/cgi/content-nw/full/340/feb05_1/c199/TBL2 depending which was more appropriate.
- Is there an easy way to do anything like this? I'm thinking that we often put crude numbers in and (%) in brackets, or CIs etc - so my exported table would not ideally be pure numbers.
- As a p value usually links two columns I might have expected to...
2010 Aug 04
2
discrete ECDF
Dear list;
I just created a utility function that replicates what I have done in
the past with Excel or OO.org by putting a formula of the form
=sum($A1:A$1) in an upper-corner of a section and then doing a "fill"
procedure by dragging the lower-rt corner down and to the right. When
divided by the grand sum of the entries this function then calculates
a 2D-discrete-ECDF.
I
2009 Dec 04
0
simple reshape of a large data frame (reshape() runs out of memory)
...lowing data frame ("wide"
transpose) based on common ID and DATEs:
ID DATE1 DATE2 VALUE.TYPE1
VALUE.TYPE2
'abcd1233' 2009-11-12 2009-12-23
123.45 NA
...
This is fairly easily achieved by reshape():
tbl2 <- reshape(tbl, direction = "wide", idvar = c("ID", "DATE1",
"DATE2"), timevar = "VALTYPE");
This works very well on toy data frames however it fails miserably on a
production dataset. The latter has more than 4,500,000 observations
(although ab...