Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Simplifying Stata v-cov matrix writing code

Open
#358 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
data

Research direction

Read input/InitialPopulations/compile/RegressionEstimates/programs.do around lines 36–51 and compare its putexcel calls with the matrix write in reg_health_mental.do around line 98. Check how the Mata loop handles putexcel and whether writing the matrix in one call is supported; the issue is resolved when the repeated writes no longer cause Excel file lock failures and the covariance matrix is written correctly.

Written by the indexing model from the issue text.

Description

Hi @dav-sonn, brief question with the below, this code is running a little buggy on my computer as it's running the putexcel command a lot of times in quick succession. Sometimes it 'overtakes' itself and crashes as the excel file is still locked by the previous step in the loop:

https://github.com/centreformicrosimulation/SimPaths/blob/a6d02df5bb596da3ed8690abda23b8417c8792f8/input/InitialPopulations/compile/RegressionEstimates/programs.do#L36-L51

Previous v-cov writing I thought put the whole matrix in the sheet in one go, e.g.:

https://github.com/centreformicrosimulation/SimPaths/blob/a6d02df5bb596da3ed8690abda23b8417c8792f8/input/InitialPopulations/compile/RegressionEstimates/reg_health_mental.do#L98

Would this new line in programs.do be replaceable with something like:

stata("quietly putexcel C2 = val")

or is this strictly not possible in the new mata-loop setup?

Dominant language
Java
Stars
26
Forks
38
Avg merge
15h 18m
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from simpaths/SimPaths

All issues in simpaths/SimPaths

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.