Python

Customer Lifetime Value in R: A Third of Your Best Customers Have Already Left

On the CDNOW panel, with a real 39 week holdout as ground truth, a Pareto/NBD model flags 32 percent of the top decile by historical spend as probably inactive. The median flagged customer then buys nothing at all, against a median of 130 for the rest of the decile. Extrapolating repeat spending overstates the holdout by 35 percent and the model undershoots it by 16, so the level is not where the argument is strongest. Fitted in R with CLVTools, with a bootstrap confidence interval computed in Python.

Synthetic Respondents in Conjoint Analysis: The Average Survives, the Price Does Not

LLM synthetic respondents are known to produce response distributions that are too narrow. Nobody writes down what that costs you. Running a conjoint through a mixed logit and into a market simulator, a panel with correct mean price sensitivity and compressed heterogeneity reproduced the human holdout choice shares almost exactly, then set the revenue-maximizing price 26% too low and sized the premium segment at less than half its true value. Simulated in R with logitr, cross-checked in Python by Gauss-Hermite quadrature.

If You Roll Out Market by Market, Your Lift Estimate Is Probably Too Low

The two-way fixed effects regression is the default for staggered geo rollouts. On simulated data where the true lift is known, it understates the effect by 41%. Here is why, and the estimator that fixes it, in R and Python.

Resolving the "expl3.sty" and Format File Mismatch Error in LaTeX (TeX Live/TinyTeX)

If you’re encountering the following LaTeX error when compiling a Bookdown or Quarto PDF document: ! LaTeX Error: Mismatched LaTeX support files detected. (LaTeX) Loading 'expl3.sty' aborted! (LaTeX) The L3 programming layer in the LaTeX format (LaTeX) is dated 2025-03-26, but in your TeX tree the files require (LaTeX) at least 2025-04-14.

Move or Copy Environment in Python

It’s likely that at some point in you data analysis or research career, you will have to either move or copy your current working/virtual environment in Python (in Anaconda or any other platform) to a new location (e.

Task Scheduler with Python and Anaconda environment

Frequently, we as researchers would like to expedite our work process with programs when we have repeated tasks. There is an easy way for you to do this with Python on your Windows computer.

use dplyr in Python - siuba library

Use siuba library in Python to preserve all your skills from dplyr package in R pip install siuba You can see TidyTuesday for tutorial Or Learn Siuba