Package: pydatalysis
PyDatalysisThepydatalysispackage is a Python library designed to provide a convenient and user-friendly interface for performing statistical analysis. Currently, the library includes a set of functions for fitting and evaluating regression models. More functions will be added soon.The package is designed to be user-friendly, with intuitive syntax and clear output. It is intended for use by researchers, data scientists.
Under the hood,pydatalysisutiize thestatsmodelsandsklearnlibraries to provide a range of data analysis and modeling functions. Essentially, this library provides a high-level interface that abstracts away many of the complexities of working with statistical models, making it easy to get started with data analysis in Python.InstallationYou can install this package using pip. Open a terminal or command prompt and type:pip install regression_analysisDependenciesnumpypandasstatsmodelssklearnLicenseThis package is licensed under the MIT License.Linear RegressionParagraphlinear_regression(data, x, y)This function performs a linear regression analysis on the input dataset.ParametersParameterData typeDescriptiondatapandas DataFrameThe input dataset.xstring or list of stringsThe name(s) of the column(s) to be used as predictor variable(s).ystringThe name of the column to be used as the response variable.ReturnsThis function returns a dictionary of tables that summarize the results of a linear regression analysis. The tables included arecoefficients table:shows the estimated coefficients and standard errors for each predictor variable,summary table:provides an overview of the regression results,diagnostics table:includes various diagnostic measures such as the residuals and leverage values.These tables can be used to evaluate the fit of the regression model and to identify any potential issues such as outliers or multicollinearity.ExmapleLogistic RegressionParagraphlogistic_regression(data, x, y)This function performs a logistic regression analysis on the input dataset.ParametersParameterData typeDescriptiondatapandas DataFrameThe input dataset.xstring or list of stringsThe name(s) of the column(s) to be used as predictor variable(s).ystringThe name of the column to be used as the response variable.ReturnsThis function returns a dictionary of tables that summarize the results of a linear regression analysis. The tables included aresummary_table:Logistic Regression Summary Table. This table provides information on the model's goodness of fit, including the number of observations, the model's Log-Likelihood value, and the Wald Chi-Square test statistic.coefficients_table:provides information on the regression coefficients of the predictors used in the logistic regression model. This table includes columns for the predictor variable name, unstandardized coefficient estimates, standardized coefficient estimates, standard error, z-value, p-value, confidence interval lower bound, confidence interval upper bound, and odds ratio.predictive_measures_table:provides information on the predictive measures of the logistic regression model. This table includes columns for the accuracy, specificity, and sensitivity of the model.classification_table:provides information on the classification accuracy of the logistic regression model. This table includes the number of true positives, true negatives, false positives, and false negatives, as well as the percentage of correct classifications for each category.