Advertisement · 728 × 90

Posts by Norm Matloff (你有冇諗清楚呀?)

Is this really true? If so, it's depressing news.

22 hours ago 1 0 0 0

Or,

> x <- "[<-"(x,3,8)
> x
[1] 6 1 8 4 5

1 day ago 3 0 0 0

Thanks, any feedback would be appreciated. We are currently converting it to published form with Taylor and Francis (with free HTML access), with my daughter, Laura Matloff, as coauthor.

1 day ago 1 0 0 0

Yes, you can view it as an operator, but the main thing to know is that "+" is a function, e.g.

> "+"(3,5)
[1] 8

Similarly,

> x <- c(6,1,1,4,5)
> "["(x,3)
[1] 1

This epitomizes the fact that R is a functional language.

1 day ago 8 0 2 0

Even though I do not use IDEs, I did install it and gave it a run a few weeks ago. I was quite impressed. The authors have clearly given very careful thought to what an IDE should do.

3 days ago 1 0 0 0
Post image

​Happy 20th Anniversary to #rdatatable! 🎂
​Since 2006, DT[i, j, by] has been the gold standard for high-performance data manipulation in R. Speed, efficiency, and elegance!
​A huge thanks to Matt Dowle, Arun Srinivasan, and all the contributors! @rdatatable.bsky.social 🥂
#rstats #rdatatable

6 days ago 10 2 0 0
Preview
Dozens of AI disease-prediction models were trained on dubious data The models are designed to predict someone’s risk of diabetes or stroke. A few might already have been used on patients.

Outstanding work by @alexdgibson.bsky.social to uncover the use of highly dubious data sets from @kaggle.com being used in hundreds of research papers and potentially even informing clinical practice. If you're re-using data, take the time to confirm that it's real. www.nature.com/articles/d41....

6 days ago 18 9 0 0
25 YeaRs: Australian & New Zealand Journal of Statistics <em>Australian & New Zealand Journal of Statistics</em> is an international statistics journal covering statistical theory, methodology, applications and computing.

The special issue of the Australian and New Zealand J. of Statistics commemorating the 25th anniversary of R (the language was developed in NZ) is finally out, with free access for the next 90 days (yes, an irony for an open source language), onlinelibrary.wiley.com/doi/toc/10.1...

1 week ago 11 1 0 0

Frank, are you familiar with the controversy over a 2022 paper by Pekar, udinh Bayesian analysis to claim Covid had a zoonotic genesis? The critics claim errors in his analysis of the chance of 2 zoonotic causes, close in time, but even without errors, should an issue like this be analyzed by Bayes?

2 weeks ago 0 0 1 0
Advertisement

I think is not talking about nested calls; she's doing nested definitions, it seems.

3 weeks ago 1 0 1 0

One of the "drawbacks" that Thomas cites is side effects. But that is precisely the reason why I use macros! (Which I have been doing for a long time using his gtools package.)

What I want is something that is basically freestanding code but has the look and feel of a function.

3 weeks ago 1 0 0 0

Yep, that's the one.

3 weeks ago 2 0 0 0

Macros in gtools have been around for a lot longer than that.

3 weeks ago 1 0 0 0

That blog post is a rare example of a package author giving a clear and convincing account of their design decisions, very nice.

3 weeks ago 3 1 0 0

The failure of the LLMs (the ones I tried) to ask whether the return value of loess() has a component like 'fitted' is quite telling, IMO. Any competent R programmer would check this as a first resort.

3 weeks ago 0 0 0 0
Post image Post image

Here are the 2 graphs, hopefully now showing as white background on your screens.

As I said, my post was just meant to make a couple of small points: a. LLMs can produce poor code even in very simple apps. b. The curves' color change can be very useful, here showing federal law.

3 weeks ago 0 0 1 0

Ah, but JPEG works. Thanks again.

3 weeks ago 0 0 0 0
Post image
3 weeks ago 0 0 0 0
Advertisement

Hmm. In the file-save function I wrote for images long ago and have been using ever since, I see that I have a call

png(filename,bg='white')

Just now, I tried adding bg='white' to my call to plot() in qepc, still have the same problem.

Thanks anyway.

3 weeks ago 1 0 0 0

Nice! I have my own Vim macros for this kind of thing, but your system is more versatile.

3 weeks ago 2 1 0 0

US census data uses "top coding." Here it meant that any wage about $350K was truncated to that value. Now remember, this is Year 2000 dollars. Those data points created an ugly bar at the top of the plot, and had the effect of flattening the curves. So I deleted any row having wage > $200K. 8/8

3 weeks ago 0 0 0 0

My call for the Economist-style graph was

qepc(svcensus[-rich,],
'age','wageinc','occ',prePost=TRUE,prePostChangePt=40)

Here qepc is the modified qePlotCurves, which I will add to qeML. What about that -rich? 7/

3 weeks ago 0 0 1 0

The LLMs did something similar, but did not take advantage of the $fitted component of the object returned by loess(). Instead, they regenerated the fitted values by calling predict() on x.

Not a big sin, but it does show that LLMs may not do well writing even very simple code. 6/

3 weeks ago 0 0 1 0

Now, an interesting point re implementation. Easy, but the LLMs that I tried seemed to miss something.

The qePlotCurves function uses loess() to smooth the data. The return value includes the x and fitted values. I called order() on x, and then called lines() twice, for the before and after. 5/

3 weeks ago 0 0 1 0

Ah, the pesky black background again! Again, the original is white. Sorry. Unfortunately, I don't have the time to hunt that down. Anyone knows what Bluesky mistake I made? There is a vertical line at age = 40, hard to see, but one can see the change in curve color to gray at that point. 4/

3 weeks ago 0 0 2 0
Post image

(Not sure where that black background came from, not in the original .png.)

So I added the feature to qePlotCurves, and got this graph below. I chose age 40 for the dividing line, as it is the cutoff in federal law on age discrimination. Seems to match the data! 3/

3 weeks ago 0 0 1 0
Advertisement
Post image

I thought it would be a nice enhancement of this plot made by qeML::qePlotCurves on a census dataset on Silicon Valley wages in 2000. Wages initially go up, but start to come down as one grows older. Different curves are for different occupations, but all are in the tech area. 2/

3 weeks ago 0 0 1 0
Post image

Here's a quick little project that I hope some will find interesting in misc. ways.

I saw the below graph in The Economist, showing pre- and post-data, here 2025. thread 1/

3 weeks ago 2 0 2 0

I have always thought the word "concentration" instead of "major" is an affectation, like Stanford's referring to its Fall term as Autumn. Is there actually a difference?

3 weeks ago 1 0 0 0

200 treated patients. 800 controls. Five covariates to match on. How do you pair them? Propensity scores collapse those five dimensions into one number and match on that. Clean and well-understood. But you can also solve the pairing directly in the original covariate space. 1/4

4 weeks ago 1 1 1 0