trying to do a single var. psm analysis using python, have done it in the past for bayesian time series: gpt is telling me i need to import some new stuff and im copying the install line but its telling me its sytax error: also for somereason while it put "python" in the top right of the rest of the suggested code, for the installation lines it labled it as "bash" I have no idea what this is.
#๐ Syntax errors installing "seaborn" for propensity score matching: complete python novice using gpt
6 messages ยท Page 1 of 1 (latest)
@vapid plank
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
the printouts in chatgpt are just best guesses for displaying code with proper syntax and linting.. ive had it give me stuff in allkinds of formats including ansi
looks like someone has written a package for psm https://pypi.org/project/psmpy/ see if does what you need. It seems to expect data input in the form of a DataFrame (from https://pandas.pydata.org/), then you do
psm = PsmPy(df, treatment='treatment', indx='pat_id', exclude = [])
``` kind of a thing where each string is the name of one of your columns and then there is a bunch of stuff you can do to get various results out of the `psm` object (all explained in the documentation)
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.