« first day (251 days earlier)      last day (3560 days later) » 

2:34 AM
@juba, FYI :-)
 
3:13 AM
anyone around to answer a quick panel/lattice question?
d'oh, found it: had to look in ?panel.the_thing instead of ?the_thing
 
4:05 AM
Does the wilcox.test tests equality of the median or mean?
I am seeing both being used to describe the test. How do I specify which?
 
From memory Wilcox is based on ranks, so by definition it can only test equality of medians?
 
@Manetheran Most of the sources that I am reading said wilcox tests medians, but one tutorial says it test mean. Majority rule then?
 
Yeah, I would suspect that tutorial is wrong
If you want to test means use a t.test?
 
Yes. I have a table to compare median ages and weight, and mean concentrations.
So I think I can use two different tests?
 
oh
Those are just the names of the columns of the tables
 
4:21 AM
thanks!
 
comparing them with those tests won't be meaningful
T.test for example would ask "Is the mean of "median age" significantly different to the mean of "median weight""
so if your mean median age is something like, 35 years of age
and your median weight is 70 kg
then both tests will tell you they are singificantly different
 
Oh, I mean, I have data for a paired experiment. I am comparing the age of case group to the control
Although my data has been awhile. I don't know which is the most updated version anymore
lol
Thank you so much for your help again
 
Yeah i'm not sure, its been ages since i've done proper statistics
i think there's a paired version of the t-test
I pulled out an old statistics cheat sheet, but there's no explanations for any of the test statistics
All i have is (X_i - Y_i) +/- t_(alpha/2) sd / sqrt(n)
where X and Y are your vectors for each pair
 
I haven't touched math for awhile either. Yeas there is a paired parameter for both tests
 
I'm not sure what the non-parametric equivalent is
yeah I'd used the paired parameter
if your vectors look normally distributed, used a paired t-test
you get more power to detect the differences
 
4:33 AM
Thank, the confirmation for my choice is quite encouraging :D
 
if they dont look normal use paired wilcoxon
 
But how about the issue with mean/median?
 
that doesn't really matter
that's just the name of your measurement
Do you have two groups, each with a "median age"?
or is the median age made up of something else?
 
I have two datasets, one for control patients and one for case patients. The table lists medians for some parameters and means for others, so I assumed that I need to compare them
 
so presumably for each sample, they've taken a bunch of measurements then aggregated them into one table
I'm a little confused about median age
 
4:45 AM
Yes, it is a big table with many columns. What's wrong with median age?
 
 
4 hours later…
8:34 AM
@AnandaMahto Thanks for the free advertising :-) I still want to look deeper at your splitstackshape package, it 's on my TODO list, I promise. Ideally I would even delegate my related functions in questionr to your package. One day, maybe...
 
9:09 AM
@juba I like the way the true.codes argument works. I don't like that because of loading your package, things get funky because of aggregate from "memisc".
 
@AnandaMahto You mean that when you load questionr, aggregate is overrided by the memisc one ?
That should not happen...
 
 
2 hours later…
10:59 AM
@juba The aggregate.formula method is taken over. Try it out. Load V0.2 of "questionr" and try example(aggregate) and see what happens. You'll get some Error in eval(expr, envir, enclos) : could not find function "fapply" nonsense. :-(
 
@AnandaMahto Argh, yes, you're right. It's only aggregate.formula, and I checked just for aggregate. :-/
The function itself is not needed by questionr, and I thought that using importFrom() into NAMESPACE would be enough to prevent these kind of problems.
I guess I still don't understand namespace and imports mechanisms that well...
 
11:16 AM
@juba, as a result, I believe that also means that microbenchmark doesn't work when your package is loaded....
 
@AnandaMahto So you mean that I broke about half your R install for a function that I don't even use...
Well, I don't get it. As I understand it, having memisc as Imports in DESCRIPTION and only importFrom(memisc,description) in NAMESPACE should prevent the collision...
Ok, let's try to investigate, or ask a question on SO
 
11:40 AM
@juba What do you make use of from "memisc"?
 
@AnandaMahto I personaly don't use anything, but the co-author which uses it is using the memisc::description function.
 
 
3 hours later…
2:25 PM
@AnandaMahto Ok, can't manage to find a solution. So I posted a question :
0
Q: How to import only one function from another package, without loading the entire namespace

jubaSuppose I'm developing a package, called foo, which would like to use the description function from the memisc package. I don't want to import the whole memisc namespace because : It is bad memisc overrides the base aggregate.formula function, which breaks several things. For example, example(a...

 
2:41 PM
@juba Have you considered this? It is typically a design mistake to use ::: in your code since the corresponding object has probably been kept internal for a good reason. Consider contacting the package maintainer if you feel the need to access the object for anything but mere inspection.
 
@RomanLuštrik I don't think it is a problem linked to :::. I don't use it myself. It seems that even if you only use importFrom, R will load the entire namespace.
See this comment from Josh O'Brien for example :
@BrianDiggs -- The upshot of this is that if you importFrom() even a single function from a package, you also register all of the methods in that package. (Quite an unexpected side-effect, though I can see why R-core did it that way.) This also explains why detaching gmodels had no impact on which reorder() method gets called: detaching does not go around and clean up all of the methods that were registered when the package was loaded. (In fact, even unloadNamespace() doesn't do that cleanup. I wonder if there's some function that does...) — Josh O'Brien Jun 13 '12 at 20:39
 
What about incorporating that function in your own package as a stand alone thing?
 
@RomanLuštrik It's a possible workaround, but the function is a complex generic S3 method. I think I'd better not use it at all instead of incorporating it :-)
 
Let's call that plan C. :)
 
According to Hadley, plan D could be to put memisc in Suggests and display a warning if require(memisc) fails :
11
A: How to properly use functions from other packages in a R package

hadleyThe basic question you need to answer is: "do you want the function to be available to all users of the package without further effort?". If yes, then use imports + the appropriate namespace declarations, if no, then use suggests and print an informative error message if require("psych") returns...

 
 
2 hours later…
5:18 PM
Be sure to check the edit history.
 

« first day (251 days earlier)      last day (3560 days later) »