经管之家App
让优质教育人人可得
立即打开
全部版块
我的主页
›
论坛
›
计量经济学与统计论坛 五区
›
计量经济学与统计软件
›
Stata专版
求助!!请问stata如何统计数据类型是字符串的出现次数
楼主
fgkjvbk
3811
2
收藏
2021-04-15
悬赏
10
个论坛币
已解决
各位stata的大佬们好,我想对数据中JournalTitle中出现的字符串进行统计,请问要怎么操作,谢谢回答!
clear
input long aid int pubyear str239 journal_title float(d_value career_age N)
4670844 2000 "The American naturalist" -.0556622 9 6
227960 2000 "Angewandte Chemie (International ed. in English)" 0 9 6
3279037 2000 "Journal of veterinary cardiology : the official journal of the European Society of Veterinary Cardiology" 0 9 6
8453307 2000 "IEEE transactions on ultrasonics, ferroelectrics, and frequency control" 0 9 6
8894826 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society" 0 9 6
4431279 2000 "The American naturalist" .0789474 9 6
527603 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society" -.025641 10 17
3412062 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society" -.012987 10 17
7351204 2000 "The American naturalist" -.0118483 10 17
1324929 2001 "Journal of evolutionary biology" -.00499445 10 17
7777752 2001 "Journal of investigative medicine : the official publication of the American Federation for Clinical Research" -.00144748 10 17
3472062 2001 "Calcified tissue international" 0 10 17
4513185 2000 "Bioscience, biotechnology, and biochemistry" 0 10 17
1070450 2001 "Phytopathology" 0 10 17
5663726 2001 "Journal of health psychology" 0 10 17
2608510 2001 "Journal of tropical pediatrics" 0 10 17
6304401 2001 "Comparative and functional genomics" .00172861 10 17
8096653 2001 "Mycorrhiza" .0078125 10 17
4717488 2000 "Avian pathology : journal of the W.V.P.A" .0163934 10 17
7188770 2000 "The American naturalist" .0632911 10 17
4452688 2001 "Angewandte Chemie (International ed. in English)" .0987654 10 17
5598028 2001 "Oecologia" .232877 10 17
9001194 2000 "Environmental management" .75 10 17
2373133 2002 "Oecologia" -.133333 11 34
5203462 2002 "Oecologia" -.072 11 34
4670844 2002 "Oecologia" -.0615385 11 34
5203462 2002 "Oecologia" -.0393701 11 34
4790330 2001 "The American naturalist" -.037037 11 34
8070924 2002 "Oecologia"
最佳答案
DΘstinyじò
查看完整内容
统计journal_title变量每一类值的个数吗?
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
全部回复
沙发
DΘstinyじò
2021-4-15 19:58:43
统计journal_title变量每一类值的个数吗?
复制代码
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
藤椅
阿斯顿马丁aa
2021-4-16 00:34:38
public class StringTest3 {
public static void main(String[] args) {
//定义一个字符串
String s = "Person1314Study";
//定义三个统计变量
int bignum = 0;
int smallnum = 0;
int numbernum = 0;
//遍历字符串,得到每一个字符。
for(int x=0;x<s.length();x++){
char ch = s.charAt(x);
//判断该字符到底是属于那种类型的
if(ch>='A' && ch<='Z'){
bignum++;
}
else if(ch>='a' && ch<='z'){
smallnum++;
}
else if(ch>='0' && ch<='9'){
numbernum++;
}
}
//输出结果。
System.out.println("含有"+bignum+"个大写字母");
System.out.println("含有"+smallnum+"个小写字母");
System.out.println("含有"+numbernum+"个数字");
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
相关推荐
stata 统计数据如何用变量形式保存?
Stata有关的各种命令(按各检验方法和数据类型等分类)
Stata统计数据均值:把A列变量等距分成十份,计算相应B列的均值
stata不同数据类型合并
stata中怎么把日期格式具体到天的只保留年份?
stata bys统计数据出现的次数排序
中国县级统计数据stata整理版
stata怎么转换字符串数据类型
stata进行面板数据固定效应回归的数据类型有无要求啊
关于str求助,用stata用城市名和年份合并两份数据,结果城市名数据类型不同
栏目导航
Stata专版
会计与财务管理
行业分析报告
宏观经济学
学道会
经管高考
热门文章
【重磅权威】2000-2024年上市公司人力资本流 ...
中国力量席卷全球- 绿色赋能地产先行 掀起全 ...
中国风能太阳能资源年景公报(2025年)
计算机行业:SpaceX,从“变革”中崛起的“ ...
求助英文文献一篇
几何(第五卷)[法] M. 贝尔热
《寻路集:在全球网络中寻找合适节点 》周其 ...
几何 (第一卷)[法] M. 贝尔热
我该如何记住你?智能体记忆系统的演化之路
CDA数据分析脱产就业班于2026年3月7日开班! ...
推荐文章
2026JG学术冬训营:从Stata初高到Python机器 ...
【必看】【本版版规,欢迎发悬赏贴求助】
26年寒假天津站|Gemini论文写作&数据分析 ...
关于如何利用文献的若干建议
关于学术研究和论文发表的一些建议
关于科研中如何学习基础知识的一些建议 (一 ...
一个自编的经济学建模小案例 --写给授课本科 ...
AI智能体赋能教学改革: 全国AI教育教学应用 ...
2025中国AIoT产业全景图谱报告-406页
关于文献求助的一些建议
说点什么
分享
微信
QQ空间
QQ
微博
扫码加好友,拉您进群
各岗位、行业、专业交流群