ASA Connect

 View Only

No need to learn how to code?

  • 1.  No need to learn how to code?

    Posted 12-13-2022 18:54
    With the release of ChatGPT, my 8th grade son is asking why he needs to learn how to write.  With the release of RTutor (below), students may ask why they need to learn to code.  Perhaps one answer is that they can be freed from writing every line of code, and instead, use their time for higher-value work like analyzing, interpreting and communicating the results.

    See http://rtutor.ai/
    -----------------------
    ..., given the mpg dataset, you can ask questions like:
    - "Are SUVs more fuel efficient than compact cars?"
    - "Conduct ANOVA of log-transformed hwy by class and drv."
    - "Use ggplot2 to create a boxplot of hwy vs. class. Color by class. Add jitter."
    RTutor will then generate functional code to answer your question, making it easy for those without R experience to conduct preliminary analysis and visualization of their data.

    Steven Ge on LinkedIn: #chatgpt #ai #stats | 165 comments
    Linkedin remove preview
    Steven Ge on LinkedIn: #chatgpt #ai #stats | 165 comments
    Hello, world! Here is your Christmas present. You've been kind to me. Based on the powerful Davinci (ChatGPT's sibling) from OpenAI, I wrote an app called... 165 comments on LinkedIn
    View this on Linkedin >



    ------------------------------
    Mark Chamness
    Head of Data Science
    Invictus Growth Partners
    ------------------------------


  • 2.  RE: No need to learn how to code?

    Posted 24 days ago

    I do not think Stats instructors have realized how important the Rtutor.ai and Chatlize.ai systems built by Dr. Ge are. Basically students now can focus more on understanding statistical concepts and apply them easily in a chat-based manner using these AI system. Everyone now becomes a statistician without learning much of the programming language which is oftentimes a barrier for general students. I wish NSF and other agencies to fund Dr. Ge's AI projects. 







  • 3.  RE: No need to learn how to code?

    Posted 23 days ago

    When I teach intro to stats classes, I use SPSS or Excel. I see absolutely NO need to use R, Python, SAS, etc. Teaching programming at that point is pretty pointless. It takes away time that SHOULD be spent learning topics or reinforcing ideas that were already taught. If someone wants to teach programming as an additional lab, great. Integrating it into the class, no thank you. 

    Having taken many stats classes where the profs insisted that we had to learn how to code, they wasted many hours doing so and usually made mistakes along the way and spent a lot of time trying to figure out what went wrong. In every case I can think of, the "special package" we "need" to use in R and according to the profs, ONLY found in R, is available in every other no code stats software for the last 3-5 versions. 

    As a statistician, I have NEVER encountered a data set where I needed some package or routine that ONLY exists in R, Python, SAS, etc. SPSS or JMP work really well for everything I have ever done. I find some of the methods in Design Expert to be quite useful too. In fact, the optimization portion of Design Expert does something that optimization algorithms in R and Python wont do and was the topic of 2 presentations I've given to local ASA groups. 

    For giving presentations, those where a stakeholders ask for "on the fly" analyses of the data you are presenting, SPSS or JMP are far superior to R, Python. In fact, a presentation I gave to a VP at a Fortune 500 company,  after going over the analysis I did with JMP, and answered all the questions he had then and there with JMP, he went back to the statisticians and yelled at them FOR using R. 

    By forcing or requiring coding languages, especially too early in an academic career, you make statistics seem like elitist endeavor. You'll get students to leave the program or not think a stats minor is worth pursuing. 



    ------------------------------
    Andrew Ekstrom

    Statistician, Chemist, HPC Abuser;-)
    ------------------------------



  • 4.  RE: No need to learn how to code?

    Posted 23 days ago
    Hi Andrew,

    I totally agree with you. Recently, a colleague introduced me to JASP, a free and user-friendly statistical software. You might want to check it out as a possible alternative to SPSS and Excel for introductory statistics courses that you teach.

    Regards,
    Dean

    H. Dean Johnson
    Washington State Data Exchange for Public Safety
    Director of Center for Interdisciplinary Statistical Education and Research
    Scholarly Professor
    Department of Mathematics and Statistics
    Washington State University
    Pullman, WA 99164-3113






  • 5.  RE: No need to learn how to code?

    Posted 22 days ago

    Interesting thoughts...

    Let's go way back to the advent of the calculator. Why did we need to learn how to add and multiply if a calculator could do it for us? Yet here we are in 2024 and students in grammar school are still learning those tables. You would be aghast if you went to a tax professional and they didn't use a computer or calculator - same with a grocery store clerk. Yet, we still teach, memorize, and have competitions on who can compute the fastest.  Why? (and why Algebra 2? taking cubed roots and n-th roots... unless you are going into physics, astrophysics, and various similar enterprises, have you ever needed the n-th root of anything in practice? or even needed to understand that concept?)

    Before we go suggesting turning the educational world on its head (because AI is the latest and greatest thing since sliced bread)...  let's think about what and why we teach what we teach - and the audience...

    Some students - absolutely, teach them "stats for consumers." Those students will likely never go on to "do" statistics, although understanding what they mean and what they can and can't do is great. Do they need to actually calculate anything? JMP or whatever program the teacher uses might be great to demonstrate what is going on - e.g. how a histogram can "change shape" depending on the number of bins, or how the mean can change with outliers, etc).  For younger people who may actually go into statistics as a career?? That class may turn them off. (personally, I loved coming from mathematics - understanding the integration and formulae - but, I'm weird).  Younger minds are so much more tech savvy than I was (am) - so many learn to code when they are in grammar school - for those kids, coding may be the thing that attracts them to the field. (AP stats using a TI calculator, can we twinkle think on that?!). I was sad to see in many high schools that "statistics" is the easy course to take as a senior for kids who don't like math (rather than, Pre Calc in some cases). We are losing so many potential statisticians to this mindset.  

    Just thoughts for a mid-day Friday... 

     



    ------------------------------
    Mary Kwasny
    Professor
    Northwestern University
    ------------------------------



  • 6.  RE: No need to learn how to code?

    Posted 22 days ago

    30% of the students I've taught at a college level have been Pre-algebra students. Those that didn't memorize those tables. They struggle with math. As a result, only 40% to 45% of those students even pass... (with most professors) For those that pass, the "A" students pass Algebra 1 about 80% of the time. Those that got an "A-", they pass Algebra 1 about 55% of the time. 

    When it comes to teaching with a calculator, my students get to borrow a calculator from me, if they need. My pre-algebra students pass at a rate of about 80%. Depending upon what class they take next, they might take the "Everyday Math" class. Where, depending upon the college/university, students are required to use Excel to do math. Given that "Experience with Office Products" is a job requirement a lot of places, this is a job critical skill. Being able to do all of those calculations in one's head looks impressive. But, there are how many ways to solve each type of problem, and if you get into a mathematically rigorous job, doing things in your head is far less impressive and practical. 

    I do agree that we should look at what we teach and really think about it. When I teach Algebra 1, Alg 2 and Pre-calc, and we are dealing with say quadratics, There are how many pages in the textbook discussing how to solve these problems? Yet, most of the problems we give our students in those classes can be done in their head. Then, students get into Chemistry and have a problem like: Ka = [X][X]/[C0-X]. They have to solve for 'X' and none of what I taught them is relevant or useful. The equation: X = (-b +/-sqrt(b^2 - 4ac))/( 2a) can solve this problem. And all the other quadratics. But, we waste time on all those other useless (in the real world) methods. 

    When you get into Econ, you can have a profit curve that mimics a quadratic equation. In the equation Y = aX^2 + bX + C, 'C' is the "start up cost" The first value of 'X' is the number of units you need to sell to "Break Even". The second value of X is the number of units you need to sell to stop making money. I believe the total profit is the area under the curve. So, the area bound by the triangle (0,0), (0,C) (X1, 0) is loss. From X1 to X2 is profit. So, I have my students calculate the profit by finding the area under a "half circle" between X1 and X2 and subtract off the area of the triangle. We can then ask a question about, "Should the company make this item?" If the profit is negative, then no. If the profit is "small" maybe. If the profit is "large", then definitely. Having a problem like this, the students get a complete idea about why they learned how to solve a quadratic. 

    When it comes to a stats class and the use of say SPSS or JMP vs R, Python, etc, for the reasons I sited, I will choose SPSS or JMP. After taking a class on Numerical Analysis, my resolve to use SPSS or JMP was strengthened. Why? SPSS and JMP hire professionals to write solid code using good programming skills and numerical analysis techniques. If the software uses something like Intel's MKL or AMD's math library, the quality of those algorithms is great!

    Meanwhile, in my stats classes, the prof's insist that you get the coefficients for a regression model using partial derivatives. Some will try to write code based upon this idea. Truth is, good software uses a pseudo-inverse. Better software uses all the cores in your CPU to do those calculations. 

    For fun, I solved this type of problem with a non-linear solver and the use of random number generation. The non-linear solver according to textbooks should use partial derivatives. In practice, no calculus is used.  

    So, if we are going to use something like R or Python, "to show what goes on" or whatever reason, does the user know what the software is doing? Does the user know how many ways you can solve the same problem? Doubt it. Can one come up with more ways to solve those same problems? certainly! 

    We definitely need to think about what we teach and why. 



    ------------------------------
    Andrew Ekstrom

    Statistician, Chemist, HPC Abuser;-)
    ------------------------------



  • 7.  RE: No need to learn how to code?

    Posted 19 days ago

    If education policy simply consists of "What do they need in their work etc.?", we've reached a nadir in our outlook as academics.

    Very few people, for example, really "need" to know that Brazil is in South America. But if someone graduates high school, let alone college, not knowing that, something is truly amiss.

    Regarding cube roots, times tables and so on, it's all part of a big picture in which students develop an intuitive feel for numbers, their sizes and their meanings. It's wonderful to show students how changing the bin size changes the shape of a histogram, say, but in order for them to understand WHY setting too narrow or too wide a bin size is problematic, they MUST have this feeling for numbers

    AND...the weakest students are the most in need of this. We can of course take the easy way out and just have them stare at histograms without much real understanding, or we can do our best to lift up the weak ones to the levels of excellent insight that they deserve.

    Think twice before signing up for a Cultural Revolution in math.



    ------------------------------
    Norm Matloff
    University of California-Davis
    heather.cs.ucdavis.edu/matloff.html
    ------------------------------



  • 8.  RE: No need to learn how to code?

    Posted 19 days ago

    If you look at a typical "Algebra" textbook. There is a lot of non-sense that we are supposed to teach. We give students "trivial" problems, teach them how to solve those trivial problems, then we let them go to other programs where none of the methods we taught are used nor useful. 

    If we used problems that come up in other fields, we would do well for ourselves and cut out a lot of garbage. Once that garbage is eliminated, we can go back and add in useful and relevant things. Like, "A doctor gives you a cancer screening test that has an accuracy of 95%. It came back positive. What is the probability you really do have cancer?" Or, "If you take the same medical screening test twice, and the first one came back positive, what is the probability the second will also come back positive?" The answer is, that it is really really likely. (The Bayesian Analysis discussions I've seen about this type of question ignore some facts and reality. With most tests, you get a positive result because you are positive, the test detects something similar and gives a positive result or lab error. Taking the same test a second time helps to eliminate a lab error.) 

    If you take 2 different types of tests that detect the same thing, one is positive, one is negative, which one do you believe?  



    ------------------------------
    Andrew Ekstrom

    Statistician, Chemist, HPC Abuser;-)
    ------------------------------



  • 9.  RE: No need to learn how to code?

    Posted 19 days ago

    I concur with Dr. Kwasny's comments. IMHO we learn the underlying methods because that gives us a way to develop a "feel" for whether our results are "reasonable." Without going through the calculations myself and learning what is a reasonable result, I could not have developed the judgment needed to tell me when "something is wrong with this picture." 

    Regarding coding ... it is a valuable skill simply because it teaches problem-solving in a structured manner. It requires looking at the problem in a way that helps you identify the critical variables and the steps needed to work out an answer. It is true that "coding may not be for everyone." But, by the same token, logic, reasoning, and disciplined thought may not be for everyone.



    ------------------------------
    NicholasMiceliNicholas S. Miceli, Ph.D.
    Consultant
    ------------------------------



  • 10.  RE: No need to learn how to code?

    Posted 19 days ago

    I spend an entire lecture in my stats classes discussing how to make the different types of plots. We also go into why we shouldn't trust them if we don't know where the data comes from. Nor, how the data was made/collected. A homework problem looks at data sets I made up where the plots look very similar. But, the BTS story is very different. It's also a discussion about the proper choice of metrics. 

    Last week we discussed data from the Flint Water Crisis with my students from Flint. I made a histogram of the raw data. There was a data point from the original data set that was "an outlier". 95% of the data was between 0ppb and 30ish ppb. there were 2 data points at 44ppb and 1 data point at 104ppb. That outlier was removed from the data set because it was too far beyond reasonable. Sadly, that opinion extended the poisoning of the people of Flint for another 12 months or so. 

    I simulated data between 0.000 and 0.499ppb for the data points that had a reported 0ppb concentration, then took the log of those data points and showed that the data was actually from a log normal distribution. Once you make that change, you see that the outlier, really does belong.

    If I remember correctly, it was far from being the largest sample collected... once they knew what was going on and collected more samples. 



    ------------------------------
    Andrew Ekstrom

    Statistician, Chemist, HPC Abuser;-)
    ------------------------------



  • 11.  RE: No need to learn how to code?

    Posted 8 days ago

    I agree with a theme I find in this thread - let's not be passive about the inevitability of using AI in our math and stats teaching and work, and similarly, choose the software tool that works best for the level and purpose of the course. I work in non-math/stats/data sci departments; we use SPSS for Stats I and II and for graduate research for the reasons already mentioned - and also because it's  table/spreadsheet data model is more intuitive  than R's vector model.  But for students in data science, learning more than one language, including R may make more sense.  Recently tutoring middle school students, the new pedagogy allows time to solve problems imaginatively and describing one's findings, or working in groups to solve a problem, there is less emphasis on speed and efficiency that the latest technology may impart. Working problems by hand can allow for teaching of the rich and diverse history of mathematics (e.g., Aryabhata triangle numbers...shout out to Algebra II!). Of course, again, the calculator, computer are really important tools and should be incorporated - but not de facto, but as needed and necessary. 



    ------------------------------
    Eugenie Coakley
    Senior Consultant/Statistician
    ------------------------------



  • 12.  RE: No need to learn how to code?

    Posted 7 days ago

    Dear All,

    Eventually, coding is in fact behind GPT or its newer versions. 

    For the general public, "prompts" are simpler and more intuitive.

    There are quite a few (10) benefits of coding that I can think of:

    (1) Logic

    (2) Structure

    (3) Object-oriented

    (4) Building (liken LEGO pieces)

    (5) Teamwork

    (6) Algorithms (e.g., elegant and succinct lines)

    (7) Open source (e.g., GitHub)

    (8) Patience (e.g., debugging)

    (9) Accomplishment (e.g., smooth-sailing)

    Have fun being hands-on, coding or waiting for others to do the legwork... 



    ------------------------------
    Kelly H. Zou, PhD, PStat, ASA Fellow
    ASA Caucus of Industry Representatives Executive Committee Member
    https://community.amstat.org/caucusofindustryrepresentatives
    ASA Lingzi Lu Memorial Award Committee Member
    https://www.amstat.org/your-career/awards/lingzi-lu-memorial-award
    ------------------------------