VB.Net Conditional Logistic Regression Algorithm

Job ID: 39325165

Budget: £10 – £20 GBP

I require a true McFadden conditional logistic regression algorithm written in Visual Basic. I would like the input to be a variable column-sized datatable, and then I'll be able to choose from the datatable which column is the group variable, dependent variable (Y), and independent variables (X).

The output of the algorithm is a structure:

Public Structure CLOGIT_Structure
Public Converged As Boolean
Public RSquared As Double
Public LogLikelihood As Double
Public Errors As Integer
Public NotSignificant As Integer
Public Coefficients As DataTable
End Structure

Converged
Whether the regression successfully converged

RSquared
The pseudo R-Squared value returned by the regression

LogLikelihood
The last log-likelihood value returned by the regression

Errors
Total number of variable errors returned by the regression

NotSignificant
Total number of insignificant variables returned by the regression, i.e. where the variable probabilty is > 0.05

Coefficients
A datatable with columns X, Coefficient, Standard Error, Z-Score, Probability, 95% ConfidenceIintervals, Errors (e.g. if there were any errors with the variable such as there being no within-group variance), and a Significant column (where probability <= 0.05).

You may use the Alglib.net library and parallel processing to improve speed.

This is fairly simple code to write as ChatGPT does a good job of producing it, but does also produce errors which require fixing.

The attached spreadsheet shows the input and output data, and also the clogit output from the STATA statistics application.
Related categories: Visual Basic VB.NET