Laurent Bergé's Avatar

Laurent Bergé

@lrberge.bsky.social

Ass prof in econ at the University of Bordeaux Too much code. https://sites.google.com/site/laurentrberge/

471 Followers  |  536 Following  |  110 Posts  |  Joined: 25.06.2023  |  2.3607

Latest posts by lrberge.bsky.social on Bluesky

Yep, this is not native.
I had to develop my own VSCode extension to make it work.

25.07.2025 20:23 — 👍 0    🔁 0    💬 0    📌 0
From the fixest NEWS file: the new default VCOV is iid for all estimations. To change the default to the way it was, place setFixest_vcov(all = "cluster", no_FE = "iid") in your .Rprofile.

From the fixest NEWS file: the new default VCOV is iid for all estimations. To change the default to the way it was, place setFixest_vcov(all = "cluster", no_FE = "iid") in your .Rprofile.

#rstats #econsky PSA: The next release of `fixest` will include some important changes (plus cool new features).

E.g. Fixed-effects regs will now default to 'iid' SEs rather than clustered. github.com/lrberge/fixe...

You can install and test drive the dev version from R-universe; see the README.

18.07.2025 15:36 — 👍 30    🔁 9    💬 2    📌 0

For the first use, there is predict.mira that does not seem to exist, so it can be created no problem.

For the second usage, it seems that MI is done to the predict method of a non-MI estimation.
=> I don't see the issue of creating a new function here bc the use case is very specific

06.07.2025 10:03 — 👍 1    🔁 0    💬 1    📌 0

In general masking any base R (including stats, utils, etc) function is a bad idea bc other packages rely on them and expect them to work in a very specific way.

I don't think what you want is possible because of the way S3 works.
Maybe change the design? It might be the easiest way.

04.07.2025 11:05 — 👍 3    🔁 0    💬 1    📌 0

Announcing sircon: a new R console! (for Windows)

It's in beta and actively developed (new patched version just released).

I've been using it for a while now and I think it's rather bug free. But if you encounter some: let me know!

github.com/lrberge/sircon

02.07.2025 15:23 — 👍 2    🔁 1    💬 1    📌 0

It's in beta though but I'm actively developing it. Comments welcome!

BTW to install:
remotes::install_github("https://github.com/lrberge/rmake")

02.07.2025 07:57 — 👍 1    🔁 0    💬 0    📌 0
Post image Post image Post image

Hey, I'm new developing a package to make reproductibility easy.

It's rmake!

Contrary to {targets}, you don't need to set up anything, it is all automatic!

So you can have modular code while writing in a single script!!!

github.com/lrberge/rmake

02.07.2025 07:57 — 👍 3    🔁 1    💬 2    📌 0

OK, thanks for your answer.

You even comment your gitignore :-), nice! (I never do that, but I should!)

24.06.2025 13:09 — 👍 0    🔁 0    💬 0    📌 0

This fool's actions may, in the end, just favor the renewable energy sector (due to the change in relative prices).

I love the irony!

23.06.2025 15:12 — 👍 2    🔁 0    💬 0    📌 0

Sorry for all those questions, thanks for sharing!

23.06.2025 13:04 — 👍 2    🔁 0    💬 1    📌 0

Did you like the quarto workflow (vàv other ways to create such websites)? Did you cut dev time by using it?

Very nice looking btw, well done!

23.06.2025 13:03 — 👍 3    🔁 0    💬 1    📌 0

Haha, thanks Grant! But TBH I don't know how soon that will be!

20.06.2025 19:02 — 👍 2    🔁 0    💬 0    📌 0
Preview
GitHub - lrberge/rmake Contribute to lrberge/rmake development by creating an account on GitHub.

There are a few productivity bonuses at the end of the presentation (which was fully written in typst btw), in particular:

- a new way to handle reproductibility in R
- a new R console (!)

Although both projects are in active dev, they work:

github.com/lrberge/rmake

github.com/lrberge/sircon

20.06.2025 14:09 — 👍 10    🔁 2    💬 1    📌 2
Post image Post image Post image

Just gave a presentation a the REGIS summer school we organised in Bordeaux.

Algorithms for empirical research

Slides and material here: github.com/lrberge/2025...

The conclusion is that, even in the age of AI, using your brain is still relevant!

#RStats #EconSky

20.06.2025 14:09 — 👍 11    🔁 5    💬 2    📌 0
Post image

github.com/kylebutts/vs...
If you are using vscode and stata, you should try out my extension. It uses interactive window which let's you write in a `.do` file but get a notebook type experience.

08.06.2025 15:07 — 👍 48    🔁 17    💬 1    📌 0

Agree. Now grading projects would require individual interactions with the students.

However:
- I don't know how to reach fairness via f2f interactions (many other factors at play)
- this proves impossible for large cohorts

Another nail in the coffin of mass education.

06.06.2025 13:52 — 👍 1    🔁 0    💬 1    📌 0

Good post that generates discussions on student's use of LLMs.

If you're a teacher, have a look!

06.06.2025 11:49 — 👍 4    🔁 1    💬 0    📌 0
Vibe coding and learning
Remember that LLMs are (philosophical) bullshit machines. They don’t care if the answer if gives you is wrong or right. They don’t care if the code runs or not. All they care about is if the answer looks plausible.

That said, in part due to the massive amount of publicly available code that’s inside their training data, LLMs can work okay with code in limited circumstances. Think of them as fancy documentation—if a programming language or package has good documentation with lots of good examples online, the stuff that LLMs generate about it will generally have good coverage and won’t be completely made up.

They work well enough that a whole new approach to programming has emerged: vibe coding. When vibe coding, you essentially tell an LLM what you want it to make and then let it actually build the whole thing. Some code editors actually allow LLMs to create and edit files directly on your computer. Like, you can say

Make a website that has a login page where users can log in and then create and edit blog posts. Create a theme for it that is mostly blue, but with some nice contrasting colors, and use a warm, friendly sans serif font. Add some photos from Flickr too.

… and it will attempt to do that, creating all the necessary files and code. It feels neat and magical to code without coding.

If you know what you’re doing, and you mistrust everything the LLM spits out, and hand-check everything it says, vibe coding can save you some time. HOWEVER it is (1) potentially dangerous, and (2) bad for learning.

Vibe coding and learning Remember that LLMs are (philosophical) bullshit machines. They don’t care if the answer if gives you is wrong or right. They don’t care if the code runs or not. All they care about is if the answer looks plausible. That said, in part due to the massive amount of publicly available code that’s inside their training data, LLMs can work okay with code in limited circumstances. Think of them as fancy documentation—if a programming language or package has good documentation with lots of good examples online, the stuff that LLMs generate about it will generally have good coverage and won’t be completely made up. They work well enough that a whole new approach to programming has emerged: vibe coding. When vibe coding, you essentially tell an LLM what you want it to make and then let it actually build the whole thing. Some code editors actually allow LLMs to create and edit files directly on your computer. Like, you can say Make a website that has a login page where users can log in and then create and edit blog posts. Create a theme for it that is mostly blue, but with some nice contrasting colors, and use a warm, friendly sans serif font. Add some photos from Flickr too. … and it will attempt to do that, creating all the necessary files and code. It feels neat and magical to code without coding. If you know what you’re doing, and you mistrust everything the LLM spits out, and hand-check everything it says, vibe coding can save you some time. HOWEVER it is (1) potentially dangerous, and (2) bad for learning.

Danger!
Because LLMs are designed to make plausible looking code, they can reference external packages that don’t exist. For instance, you might want to make a lollipop chart, and it’ll say something like

Certainly! First, run remotes::install_github("someone/gglollipop") and then run library(gglollipop) to load it.

BUT GUESS WHAT. There is no package named {gglollipop}. It’s not a thing. Malicious actors also vibe code and look for the names of packages that LLMs think should exist, then they go and create those packages themselves, but include malware in those fake packages. If you’re using an editor that allows LLMs to make changes to your computer, it can run all this code without you knowing what happens and bad things can happen.

Additionally, vibe-coded code can run well but be full of security vulnerabilities and issues and inefficiencies and bugs. The code it generates is essentially an average of all other code online—it will have bugs and security issues.

It’s also incredibly easy to accidentally expose private information to LLMs, like feeding them passwords, usernames, private data, and so on, especially if you’re mindlessly generating and running code.

Always distrust and be suspicious about all code that LLMs generate.

Danger! Because LLMs are designed to make plausible looking code, they can reference external packages that don’t exist. For instance, you might want to make a lollipop chart, and it’ll say something like Certainly! First, run remotes::install_github("someone/gglollipop") and then run library(gglollipop) to load it. BUT GUESS WHAT. There is no package named {gglollipop}. It’s not a thing. Malicious actors also vibe code and look for the names of packages that LLMs think should exist, then they go and create those packages themselves, but include malware in those fake packages. If you’re using an editor that allows LLMs to make changes to your computer, it can run all this code without you knowing what happens and bad things can happen. Additionally, vibe-coded code can run well but be full of security vulnerabilities and issues and inefficiencies and bugs. The code it generates is essentially an average of all other code online—it will have bugs and security issues. It’s also incredibly easy to accidentally expose private information to LLMs, like feeding them passwords, usernames, private data, and so on, especially if you’re mindlessly generating and running code. Always distrust and be suspicious about all code that LLMs generate.

Bad for learning!
Some people claim that vibe coding helps them learn how to code. This is most likely not the case—pure vibe coding likely hurts learning. Think of learning to code like learning a language. You could try to learn French by watching hours and hours of French movies, and you’d certainly pick stuff up, but you won’t learn nearly as well as you would by taking a dedicated French class.

You need the foundation first. If you take a few years of French classes and then watch hours and hours of French movies, you’ll learn a lot. If you jump right into a pure media-based approach to learning, it’ll be detrimental to learning the language.

Recent research explores this idea with LLMs:

Students who substitute some of their learning activities with LLMs (e.g., by generating solutions to exercises) increase the volume of topics they can learn about but decrease their understanding of each topic. Students who complement their learning activities with LLMs (e.g., by asking for explanations) do not increase topic volume but do increase their understanding. We also observe that LLMs widen the gap between students with low and high prior knowledge. (Lehmann, Cornelius, and Sting 2025)

Prior knowledge is essential if you want to do any code-related stuff with LLMs, and even then, LLMs are helpful when asking for explanations (e.g. “This code works, but I don’t know why! Can you explain what’s happening with geom_point() here?”), but far less helpful for learning than just generating plausible-looking answers.

Bad for learning! Some people claim that vibe coding helps them learn how to code. This is most likely not the case—pure vibe coding likely hurts learning. Think of learning to code like learning a language. You could try to learn French by watching hours and hours of French movies, and you’d certainly pick stuff up, but you won’t learn nearly as well as you would by taking a dedicated French class. You need the foundation first. If you take a few years of French classes and then watch hours and hours of French movies, you’ll learn a lot. If you jump right into a pure media-based approach to learning, it’ll be detrimental to learning the language. Recent research explores this idea with LLMs: Students who substitute some of their learning activities with LLMs (e.g., by generating solutions to exercises) increase the volume of topics they can learn about but decrease their understanding of each topic. Students who complement their learning activities with LLMs (e.g., by asking for explanations) do not increase topic volume but do increase their understanding. We also observe that LLMs widen the gap between students with low and high prior knowledge. (Lehmann, Cornelius, and Sting 2025) Prior knowledge is essential if you want to do any code-related stuff with LLMs, and even then, LLMs are helpful when asking for explanations (e.g. “This code works, but I don’t know why! Can you explain what’s happening with geom_point() here?”), but far less helpful for learning than just generating plausible-looking answers.

I can typically tell when you submit code generated by an LLM; it has a certain vibe/style to it and often gives you extraneous code that you don’t actually need to use. Like this—this comes right from ChatGPT:

# Load the required libraries
library(dplyr)

# Read a file named cars.csv into the R session
data <- read.csv("data/cars.csv")

# Calculate the average value of cty by class
average_cty_by_class <- data %>%
  group_by(class) %>%
  summarize(average_cty = mean(cty, na.rm = TRUE), .groups = "drop")

# Show the results
print(average_cty_by_class)

The “tells”
Here’s how I can tell that that ↑ code comes from an LLM:

Comments at every stage
read.csv() instead of read_csv(),
The older %>% pipe instead of the newer |> pipe
na.rm = TRUE inside mean()
.groups = "drop" inside summarize()
Using print() to show the created object
In general, don’t ever just copy/paste from ChatGPT and hope it runs. If you do use these tools, use them to ask for explanations. Make sure you know what every line of code is doing. For example, if it spits out summarize(average_cty = mean(cty, na.rm = TRUE), .groups = "drop"), and you don’t know what those na.rm = TRUE or .groups = "drop" things mean, look at the help page for mean() and see what na.rm actually does so you can decide if you really need to use it or not, or ask the LLM why it included it.

I will call out code that looks vibe-coded in your assignments. Please don’t do it.

I can typically tell when you submit code generated by an LLM; it has a certain vibe/style to it and often gives you extraneous code that you don’t actually need to use. Like this—this comes right from ChatGPT: # Load the required libraries library(dplyr) # Read a file named cars.csv into the R session data <- read.csv("data/cars.csv") # Calculate the average value of cty by class average_cty_by_class <- data %>% group_by(class) %>% summarize(average_cty = mean(cty, na.rm = TRUE), .groups = "drop") # Show the results print(average_cty_by_class) The “tells” Here’s how I can tell that that ↑ code comes from an LLM: Comments at every stage read.csv() instead of read_csv(), The older %>% pipe instead of the newer |> pipe na.rm = TRUE inside mean() .groups = "drop" inside summarize() Using print() to show the created object In general, don’t ever just copy/paste from ChatGPT and hope it runs. If you do use these tools, use them to ask for explanations. Make sure you know what every line of code is doing. For example, if it spits out summarize(average_cty = mean(cty, na.rm = TRUE), .groups = "drop"), and you don’t know what those na.rm = TRUE or .groups = "drop" things mean, look at the help page for mean() and see what na.rm actually does so you can decide if you really need to use it or not, or ask the LLM why it included it. I will call out code that looks vibe-coded in your assignments. Please don’t do it.

Updated my "AI, LLMs, and bullshit" mini-lecture post in my dataviz class with a new section on vibe coding datavizs25.classes.andrewheiss.com/resource/ai-...

05.06.2025 15:04 — 👍 268    🔁 64    💬 17    📌 15

The pblm is that most students don't care abt learning, they only care abt grades.

Who cares about learning? Students with this character trait, acquired mostly thanks to the family.

With LLM stripping off extrinsic motivation (good grades = work), we end up with yet more tech induced inequality.

06.06.2025 11:46 — 👍 4    🔁 0    💬 0    📌 0

I fully agree with your approach but then comes the grades.

Students who genuinely try to learn and struggle may get worse grades that others that don't care and use full LLM w/t thinking.

This is highly unfair for the former students and they may suffer from that.

06.06.2025 07:46 — 👍 3    🔁 0    💬 1    📌 0
Preview
Posit We’re happy to announce that we’re supporting Typst by funding one of their full-time engineers.

At Posit, we love @typst.app:

⚡ Make PDFs in milliseconds, not minutes
✨ The power of LaTeX with today's technologies
✍️ Modern typography (including emojis!)
🧠 Clear mental model

So I'm thrilled to announce that we're now supporting its development: posit.co/blog/posit-a...

#rstats

03.06.2025 13:47 — 👍 242    🔁 54    💬 5    📌 11

UBB's early cancelled try was pretty nice!

26.05.2025 13:53 — 👍 1    🔁 0    💬 0    📌 0
My BlueSky feed; filled with three mentions of Overleaf being down due the upcoming NeurIPS deadline.

My BlueSky feed; filled with three mentions of Overleaf being down due the upcoming NeurIPS deadline.

I had to endure some teasing from my collaborators for choosing to write our NeurIPS submission in @typst.app – looks like I have one more reason to believe I made the right call... 😅

14.05.2025 08:48 — 👍 14    🔁 2    💬 3    📌 0
Post image

This is a great article in the latest issue of the JEP for anyone teaching panel methods (any level). Love this history of economic terms and ideas feature. #Econsky

pubs.aeaweb.org/doi/pdfplus/...

10.05.2025 09:29 — 👍 88    🔁 23    💬 4    📌 1
Post image Post image Post image Post image

#rstats #SWE
2021 R Journal issue on software engineering practices in R dev community: journal.r-project.org/issues/2021-2/
Target paper calling for research : journal.r-project.org/articles/RJ-... Wonder if there are recent interventions on the state of SWE with R [beside great work by rOpenSci]

04.05.2025 20:32 — 👍 4    🔁 2    💬 1    📌 0

Sorry I poured some base v tidy vibes :-)

Thanks for sharing your post!

27.04.2025 19:37 — 👍 1    🔁 0    💬 1    📌 0
example of a function using non standard evaluation in pure base R

example of a function using non standard evaluation in pure base R

Nice post!

I honestly find it waaay easier and intuitive in pure base R (w/t tidy slop, with all due respect! :-))

I also teach this kind of things, but in pure base R, and the students (not all of course) usually quickly grasp how to do and expand the approach.

25.04.2025 09:51 — 👍 8    🔁 0    💬 3    📌 0
On collinearity

Blog post (fixest vignette) on "Collinearity": something everybody faces one day but for which there's not much guidance.

Trying to clarify how econometrics software handle collinearity and what one should do about it.

#RStats #EconSky

Comments welcome

lrberge.github.io/fixest/artic...

21.04.2025 16:10 — 👍 18    🔁 7    💬 1    📌 0

PyFixest 0.29 is on PyPi!

- We have updated how small sample adjustments are computed. PyFixest inference matches fixest now 100%, out of the box and all of the time!
- We have added support for fully saturated event studies, which in turn enables @apoorvalal.com's DiD specification tests.

19.04.2025 12:37 — 👍 20    🔁 9    💬 4    📌 0

@lrberge is following 20 prominent accounts