This is the best explanation i found on the internet. Thanks for the animations for the understanding.
Re: Introduction to Bayesian statistics, part 2: MCMC and the Metropolis–Hastings algorithm
Re: Introduction to Bayesian statistics, part 2: MCMC and the Metropolis–Hastings algorithm
absolutely brilliant. In the above example, Binomial is a target distribution and beta is proposal distribution. Is it correct?
Re: Group comparisons in structural equation models: Testing measurement invariance
HI do you know if its possible setting :
variance(Spatial@1) mean(Spatial@0)
In s builder dialog to plot a diagram?
Re: Stata/Python integration part 5: Three-dimensional surface plots of marginal predictions
I have the same problem. Clearly something is missing. Does anyone have a working example?
Re: Stata support for Apple Silicon
Had missed this but thanks much for the response and the clear explanation; it's very helpful.
Re: Stata/Python integration part 5: Three-dimensional surface plots of marginal predictions
Hi Luis and Shawn,
Here is a code that works for me:
webuse nhanes2, clear
logistic highbp c.age##c.weight
quietly margins, at(age=(20(5)80) weight=(40(5)180)) ///
saving(predictions, replace)
use predictions, clear
rename _at1 age
rename _at2 weight
rename _margin pr_highbp
save predictions, replace
// Create the three-dimensional surface plot with Python
python:
# Import the necessary Python packages
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('TkAgg')
# Read (import) the Stata dataset "predictions.dta"
# into a pandas data frame named "data"
data = pd.read_stata("predictions.dta")
# Define a 3-D graph named "ax"
ax = plt.axes(projection='3d')
# Render the graph
ax.plot_trisurf(data['age'], data['weight'], data['pr_highbp'],
cmap=plt.cm.Spectral_r)
# Specify the axis ticks
ax.set_xticks(np.arange(20, 90, step=10))
ax.set_yticks(np.arange(40, 200, step=40))
ax.set_zticks(np.arange( 0, 1.2, step=0.2))
# Specify the title and axis titles
ax.set_title("Probability of Hypertension by Age and Weight")
ax.set_xlabel("Age (years)")
ax.set_ylabel("Weight (kg)")
ax.zaxis.set_rotate_label(False)
ax.set_zlabel("Probability of Hypertension", rotation=90)
# Specify the view angle of the graph
ax.view_init(elev=30, azim=240)
plt.show()
# Save the graph
#plt.savefig("Margins3d.png", dpi=1200)
end
Re: How to simulate multilevel/longitudinal data
@Dick Campbell
Based on the last example with the Toeplitz correlated random errors, would that approach potentially be reasonable for other cases where you would want to have specified correlation between the covariates?
Re: Estimating the parameters of DSGE models
I have the same problem.
Re: Estimating the parameters of DSGE models
Hello, in Stata /// is used to join the next line with the current line; type "help comments" in Stata to learn more about this. This should only be used in the Do-file Editor. Looking at the error above, it seems as though E.F. issued each equation separately, but the whole command, meaning -dsge- and all the equations, should be issued together. You can copy the -dsge- command as shown, paste it into a do-file and run the whole do-file.
Re: Calculating power using Monte Carlo simulations, part 4: Multilevel/longitudinal models
580 / 5000
Resultados de traducción
Very interesting, but I have not been able to run the program, from the simulation and model comparison part, stata sends me an error in this command: local reject = cond (`conv1 '+` conv2' == 2, (r (p ) <`alpha '),.) and already in the power estimation part at the end of the program it sends me this other error:
. power simmixed, n1 (5 6) n (100 (100) 500) reps (1000)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcommand if is unrecognized
command local rc is unrecognized
command local rc is unrecognized
command if is unrecognized
r (199);
Could someone help me?
Re: Importing Twitter data into Stata
I have followed all these steps but I'm getting this at the point of running the searchtweets command. Stata 16.1.
java.lang.ClassNotFoundException: com.stata.drd.stTwitter
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at com.stata.Javacall.load(Javacall.java:119)
at com.stata.Javacall.load(Javacall.java:90)
Can you help? Thank you.
Re: Programming an estimation command in Stata: Handling factor variables in optimize()
Bonjour,
je suis à la recherche de commande stata pour estimer un modèle de données de panel dynamique spatial. j'ai pensais à un GMM-Système mais le soucis est que cette méthode ne prend pas en compte les effets spatiaux.
Cordialement.
Oumar Baldé.
Re: Export tabulation results to Excel—Update
Is there a way we can sort with tab2docx (as we can with tab)?
Re: Export tabulation results to Excel—Update
Hi Chris, I imagine that you have moved on from Stata now! I wanted to thank you and say that this command is an absolute life saver!
Is there a way that we could add sorting functionality with this command? With tab, we can simply type tab, sort - is something like that feasible with tab2docx?
Re: How to create animated graphics to illustrate spatial spillover effects
Same here. I don't understand why it always say l^ is invalid name. Did you overcome it?
Re: Vector autoregressions in Stata
I need this data set. Can anybody help me in this regard
Re: Stata for Mac with Apple Silicon
ESET is a simple to install and activate antivirus. You'll need an activation code to activate it, and you'll be able to do it swiftly. However, an ACT error notice, such as ACT.0, ACT.5, ACT.7, and others, may appear after activation from the ESET internet security site. We'll go over how to resolve or troubleshoot these difficulties on your own in this blog. Reinstalling ESET software, such as ESET internet security or ESET premium security, may not always resolve these issues. If the steps below do not resolve your issues, send an email to ESET technical support and make contact with them via ESET Contact Nederland.
Re: Fun with Frames
Is the patients.dta file available so that we can try the examples?
Re: Customizable tables in Stata 17, part 3: The classic table 1
In your previous two postings, I demonstrated how to create a table using the new and improved table command, as well as how to alter and export the table using the collect commands. You wish to show us how to utilise these tools to produce a table of descriptive statistics known as a "classic table 1" in this post. The table in the Microsoft Word document below is our target.
---------------------------
Gmail Nederland
Re: Adding recession shading to time-series graphs
Thank you for posting, I was trying to replicate your code in order to shade a recession area for an analysis that I am conducting.
I have time series data from 1997m1 to 2019m12, and what I was trying to do is shade the area between 2011m6 to 2019m12. but for some reason I wasn't able to do it
1st : To plot the shading region:
twoway area inflation time if tin (2011m6, 2019m12) I got an error "tin not found"
2nd. To plot the entire line
twoway line inflation time
If is possible to you to help me I will really appreciate!